Load the static list from REST-API

Highlighted
Anonymous
Not applicable

Load the static list from REST-API

Hi Team,

Could you please guide me how to load the contents of the static list created under Database Section with the help of REST-API

how the JSON for the same looks like?

From the referred documents I came to know about this API :- /rest/v1/lists/{listId}/leads.json

Is this the right approach ? If yes then what would be JSON looks like for this?

2 REPLIES 2
Highlighted
Level 10 - Community Moderator

Re: Load the static list from REST-API

Is this the right approach ?

Yes.

If yes then what would be JSON looks like for this?

Why not GET the endpoint and see for yourself?

Highlighted
Marketo Employee

Re: Load the static list from REST-API

Here is an example that adds two leads to a list.  The listId is 3373.  The leadId's are 318594 and 31895.

==Request==

POST /rest/v1/lists/3373/leads.json

{

   "input":[

      {

         "id": "318594"

      },

      {

         "id": "31895"

      }

   ]

}

==Response==

{

    "requestId": "137a3#15c404678cd",

    "result": [

        {

            "id": 318594,

            "status": "added"

        },

        {

            "id": 31895,

            "status": "skipped",

            "reasons": [

                {

                    "code": "1004",

                    "message": "Lead not found"

                }

            ]

        }

    ],

    "success": true

}