Carl Ogden Posted March 23, 2022 Posted March 23, 2022 (edited) Hi I've tried a curl request to obtain a contact, after I've found it by searching with the following $curl = curl_init('https://api.accounting.sage.com/v3.1/contacts?search=' . $CID); As it've found the contact and have the $id and $path, when I now try to update the contact with: $curl = curl_init('https://api.accounting.sage.com/v3.1'.$existing_contact); Note - $existing_contact contains /contacts/{id} This is built with the same code and creating a contact (which works), but I now get: "results" => array:1 [▼ 0 => array:4 [▼ "$severity" => "error" "$dataCode" => "MethodNotAllowed" "$message" => "The requested HTTP method is not allowed on this path." "$source" => "Gateway" Any ideas of what I've done wrong? Regards Carl. Edited March 23, 2022 by Carl Ogden incorrect spelling
Steel, Mark Posted March 23, 2022 Posted March 23, 2022 Hi Carl, thanks for your question. What http verb are you using to update the contact please? It needs to be a PUT request when updating. Thanks Mark 1
Carl Ogden Posted March 23, 2022 Author Posted March 23, 2022 Hi Mark Ah! I've placed a "POST", that sorted it perfectly. Many thanks Carl.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now