Piyush Khera
Piyush Khera

Reputation: 527

414 Request-URI too long - Marketo REST API Get Muliple Leads by List ID

I am extracting lead data using the 'Get Multiple Leads by List Id' REST API with GET method. However there are more that 650 fields that are required to be fetched. If I pass a comma separated list of all the fields as the URL param and make a GET request, the api returns a 414 Request-URI Too Long error.

Is there a way to fetch all the fields (more that 650) from marketo using the REST API? The api does not support POST method.

Error response in POSTMAN:

<html>
<head>
    <title>414 Request-URI Too Large</title>
</head>
<body bgcolor="white">
    <center>
        <h1>414 Request-URI Too Large</h1>
    </center>
    <hr>
        <center>nginx</center>
    </body>
</html>

Upvotes: 0

Views: 3428

Answers (2)

Piyush Khera
Piyush Khera

Reputation: 527

I was able to resolve this using POST method and passing the fields parameter as a post parameter.

curl -X POST -H "Authorization: Bearer <access_token>" -H "Cache-Control: no-cache" 
-H "Content-Type: multipart/form-data;" -F "fields=company" 
"https://<endpoint>/rest/v1/list/1001/leads.json?_method=GET"

Upvotes: 1

Jep
Jep

Reputation: 384

I don't know a solution for the REST API, however you can use the SOAP API because it will return all fields by default. Use getMultipleLeads: http://developers.marketo.com/documentation/soap/getmultipleleads/, specify leadSelector=StaticListSelector, staticListName = your list name or staticListId = your list ID.

Upvotes: -1

Related Questions