Hi,
I'm trying to add member to program via REST API.
It seems like pushToMarketo endpoint works good.
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?
Solved! Go to Solution.
Sorry, that endpoint isn't available until the Q3 release. I will fix the docs. Please use Create/Update Leads instead.
Strange, the API documentation says that the 605 Error is related to GET, not POST. Maybe Kenny Elkington can help out here?
Hi Kenny,
Thank you for your answer.
Can i use Sync Leads endpoint for add member(leads) to program?
I can't find program identifier in SyncLeasdRequest.
Is there any other endpoint which can add member to program?
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...
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"}]}
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.
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?
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?
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