SOLVED

'Get Import Lead Failures' and 'Get Import Lead Warnings' resources fail with HTTP 404

Go to solution
Anonymous
Not applicable

'Get Import Lead Failures' and 'Get Import Lead Warnings' resources fail with HTTP 404

I'm trying to test the 'Get Import Lead Failures' and 'Get Import Lead Warnings' GET methods against the Marketo Sandbox environment. When I send requests to these two resources, I get an HTTP 404.

Below are the requests I'm sending and the responses I'm getting. Could you kindly let me know what's causing this issue and whether I'm doing anything wrong? I'm sending the requests based on the API documentation.

Get Import Lead Failures

Request Passed

GET https://743-YFC-765.mktorest.com/bulk/v1/leads/batch/2584/failures.json

[no cookies]

Request Headers:

Connection: keep-alive

Authorization: Bearer 5a666b45-0f38-4ce8-a9a4-d41a85753443:sn

Host: 743-YFC-765.mktorest.com

User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_91)

Returned response

Thread Name: [Direct Invocation of Marketo API Backend] - Bulk Lead Database Uploads APIs 1-1

Sample Start: 2018-04-20 14:29:53 AEST

Load time: 65

Connect Time: 0

Latency: 65

Size in bytes: 121

Headers size in bytes: 121

Body size in bytes: 0

Sample Count: 1

Error Count: 1

Data type ("text"|"bin"|""):

Response code: 404

Response message: Not Found

Response headers:

HTTP/1.1 404 Not Found

Server: nginx

Date: Fri, 20 Apr 2018 04:29:53 GMT

Content-Length: 0

Connection: keep-alive

HTTPSampleResult fields:

ContentType:

DataEncoding: null

Get Import Lead Warnings

Request Passed

GET https://743-YFC-765.mktorest.com/bulk/v1/leads/batch/2584/warnings.json

[no cookies]

Request Headers:

Connection: keep-alive

Authorization: Bearer 5a666b45-0f38-4ce8-a9a4-d41a85753443:sn

Host: 743-YFC-765.mktorest.com

User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_91)

Returned response

Thread Name: [Direct Invocation of Marketo API Backend] - Bulk Lead Database Uploads APIs 1-1

Sample Start: 2018-04-20 14:29:53 AEST

Load time: 29

Connect Time: 0

Latency: 29

Size in bytes: 121

Headers size in bytes: 121

Body size in bytes: 0

Sample Count: 1

Error Count: 1

Data type ("text"|"bin"|""):

Response code: 404

Response message: Not Found

Response headers:

HTTP/1.1 404 Not Found

Server: nginx

Date: Fri, 20 Apr 2018 04:29:53 GMT

Content-Length: 0

Connection: keep-alive

HTTPSampleResult fields:

ContentType:

DataEncoding: null

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: 'Get Import Lead Failures' and 'Get Import Lead Warnings' resources fail with HTTP 404

Correct.

RESTful paths (Marketo doesn't always use them, but here they do) follow HTTP semantics. So an HTTP GET for a nonexistent resource path should return a 404. If it returned a 200 then that would misrepresent the fact that the resource does not exist.

Please mark my answer as Correct when you get a chance, thanks.

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: 'Get Import Lead Failures' and 'Get Import Lead Warnings' resources fail with HTTP 404

These endpoints are RESTful. If there are no errors or warnings, you'll get a 404 because the requested resource (a file with the offending rows) does not exist.

If there are errors, you'll get a CSV response.

You'll know whether to check for warnings/errors from the response to status.json, i.e.

"numOfLeadsProcessed": 1,

"numOfRowsFailed": 0,

"numOfRowsWithWarning": 1,

"message": "Import succeeded, 1 records imported (1 members), 1 warning."

Note the Bulk Import endpoint is generous with what it accepts without throwing exceptions (i.e. without generating an exception file). Don't expect that just because an import did not throw errors that all your data values entered the database. For example, a field that's blocked under Block Updates is not an exception. On the other hand, a malformed Email is a warning exception.

Anonymous
Not applicable

Re: 'Get Import Lead Failures' and 'Get Import Lead Warnings' resources fail with HTTP 404

Hi Sanford,

Thanks a lot for the response. If I understood you correctly, since my insertion was successful and no errors were returned, these endpoints are returning me a HTTP 404 for the given batchId since no error files are present. And thank you for the additional details. I will work on this and get back to you if I have further questions.

Thank you,

Evanthika

SanfordWhiteman
Level 10 - Community Moderator

Re: 'Get Import Lead Failures' and 'Get Import Lead Warnings' resources fail with HTTP 404

Correct.

RESTful paths (Marketo doesn't always use them, but here they do) follow HTTP semantics. So an HTTP GET for a nonexistent resource path should return a 404. If it returned a 200 then that would misrepresent the fact that the resource does not exist.

Please mark my answer as Correct when you get a chance, thanks.