SOLVED

Re: Receiving 605 Request method 'POST' not supported for pushToMarketo endpoint

Go to solution
Anonymous
Not applicable

Hi,

I'm trying to add member to program via REST API.

It seems like pushToMarketo endpoint works good.

http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads/...

But actually pushToMarketo endpoint returns error like below.

{

  "requestId": "7987#15728dda713",

  "success": false,

  "errors": [

    {

      "code": "605",

      "message": "Request method 'POST' not supported"

    }

  ]

}

I send POST request but response said POST not supported.

Is the pushToMaketo API is not supported?

Tags (2)
1 ACCEPTED SOLUTION
Kenny_Elkington
Marketo Employee

Sorry, that endpoint isn't available until the Q3 release.  I will fix the docs.  Please use Create/Update Leads instead.

View solution in original post

13 REPLIES 13
Kenny_Elkington
Marketo Employee

Sorry, that endpoint isn't available until the Q3 release.  I will fix the docs.  Please use Create/Update Leads instead.

Anonymous
Not applicable

Is this available yet? I am trying to create and add lead to a program as a member and cannot do the latter.

URL I am using:

$program_url = $this->host . "/rest/v1/leads/programs/" . $programId . "/status.json?access_token=" . $token;

Results I am echoing:

Program request body: {"lookupField":"id","input":[{"id":1532589,"status":"new status"}]}

Program request response: {"requestId":"f108#15863ca68a7","success":false,"errors":[{"code":"605","message":"Request method 'POST' not supported"}]}

Kenny_Elkington
Marketo Employee

Well, this is a separate endpoint.  I'm not sure why the error is incorrect, but status is a member at the top-level of the JSON body, not in each individual lead, which is likely why the call is failing.

Anonymous
Not applicable

Program request body: {"status":"new status","lookupField":"id","input":[{"id":1532589}]}

Program request response: {"requestId":"32b0#15863ef880f","success":false,"errors":[{"code":"605","message":"Request method 'POST' not supported"}]}

Is that were status is supposed to go? Yeah I'm not sure why it's not receiving 'POST' since that's what it says on the documentation... any advice on how to troubleshoot?

Kenny_Elkington
Marketo Employee

I think maybe you're URL isn't incorrect.  It doesn't look like the 605 can be thrown at any point if the method is actually invoked.  Can you share the full URL/Headers/Body that you're using?

Anonymous
Not applicable

This is my code:

$program_url = $this->host . "/rest/v1/leads/programs/" . $programId . "/status.json?access_token=" . $token;

  $lead = new stdClass();

  $lead->id = $lead_id;

  $body = new stdClass();

  $body->status = 'new status';

  $body->lookupField = 'id';

  $body->input = array($lead);

  $program_requestBody = json_encode($body);

  $program_ch = curl_init($program_url);

  curl_setopt($program_ch,  CURLOPT_RETURNTRANSFER, 1);

  curl_setopt($program_ch, CURLOPT_HTTPHEADER, array('accept: application/json','Content-Type: application/json'));

  curl_setopt($program_ch, CURLOPT_POST, 1);

  curl_setopt($program_ch, CURLOPT_POSTFIELDS, $program_requestBody);

  curl_getinfo($program_ch);

  $program_response = curl_exec($program_ch);

The output that I gave before is $program_requestBody and $program_response

SanfordWhiteman
Level 10 - Community Moderator

Can't repro this.  Your second JSON payload shape looks correct.

{

"status":"new status",

"lookupField":"id",

"input":[{"id":123456}]

}

Anonymous
Not applicable

Also I use this url

$this->host . "/rest/v1/leads.json?access_token=" . $token;

for creating the lead, which is working. host and token portions are correct.

SanfordWhiteman
Level 10 - Community Moderator

I will say that the error message you get when attempting to set a lead to the same or previous status is very misleading, since it's the same as if the lead truly does not exist in the database:

{

  "requestId": "8494#158645ade0c",

  "result": [

    {

      "id": 3893678,

      "status": "skipped",

      "reasons": [

        {

          "code": "1004",

          "message": "Lead not found"

        }

      ]

    }

  ],

  "success": true

}

Kenny Elkington

Kenny_Elkington
Marketo Employee

Thanks, I'll see if we can't get this in the pipeline

Anonymous
Not applicable

Hi Kenny,

Thank you for your answer.

Can i use Sync Leads endpoint for add member(leads) to program?

http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads/...

I can't find  program identifier in SyncLeasdRequest.

Is there any other endpoint which can add member to program?

Kenny_Elkington
Marketo Employee

Program status is managed through a separate endpoint from lead sync: http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#/Leads/c...

Dory_Viscoglio
Level 10

Strange, the API documentation says that the 605 Error is related to GET, not POST. Maybe Kenny Elkington​ can help out here?

pastedImage_0.png