1

I have the need to create/update a contact from an external site. If I understand correctly, the only way to do this is to use Rest API. In my test I had no problem to read the database, but when using the "create" action, as in the following PHP code:

$url='http://.../sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=create&api_key=...&key=...&json={"sequential":1,"first_name":"Gianni","last_name":"Predan"}';

$responsestr = file_get_contents($url);

I obtain the error "All requests that modify the database must be http POST, not GET."

What should I do? Thanks

1 Answer 1

2

What you are asking is "How do I send a POST request with PHP?". See the following stackoverflow question: https://stackoverflow.com/questions/5647461/how-do-i-send-a-post-request-with-php .

1
  • Thank Kainuk, in Itaky we says "I was lost in a glass of water"
    – marcello
    Nov 17, 2016 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.