2 Replies Latest reply on May 25, 2017 8:47 AM by David Everly

    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?

        • Re: Load the static list from REST-API
          Sanford Whiteman

          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?

          • Re: Load the static list from REST-API
            David Everly

            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

            }