OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions How to use the new Web API – Sample Code

This topic contains 8 replies, has 5 voices, and was last updated by  jithin 4 years, 6 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • #29057

    Mike Kudelya
    Participant

    Hi!

    I have described how to create extend entity there. Similarly you can create other entities.

    After you generated api key and created wsse header, this command returns all contacts:

    #29058

    kirank
    Participant

    Thanks.This was very helpful.

    #29059

    mdoens
    Participant

    Hello Mike,
    Can you also give an example of a PATCH example? i’m trying a simple lead e-mail patch:

    wsse & api is working, but i get:

    [{“title”:”extra fields constraint”,”detail”:”This form should not contain extra fields: \”{\”email\”:\”test@doens_nl\”}\””}]

    #29060

    Mike Kudelya
    Participant

    Hi,

    I have tried something like this and it works. Probably $dataUpdate should contains json presented below.

    testing.sh:

    testing.json:

    #29061

    mdoens
    Participant

    Hello Mike,
    i got it working, it was the $data array + wrong content-type header, it has to be /vnd.api+json an nothing different

    full example including wsse header:

    #29062

    adriwan_kenoby
    Participant

    If it could be usefull for anyone :

    #40590

    jithin
    Participant

    Can someone send a sample PHP code to list all contacts in OROcrm?

    #40601

    jithin
    Participant

    Hi Andrey, Thanks for the reply. I’ve been trying to list accounts and contacts from OROCRM. Its working fine from OROCRMurl/api/doc/rest_json_api. But when i try the same request with CURL command in the command line am getting a 401 Unauthorized error. I am using PHP curl in my scripts. I get same 401 error from PHP script as well. I made sure headers are generated for each requests. Do you have any idea why i am getting “401 Unauthorized”?

Viewing 8 replies - 1 through 8 (of 8 total)

The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.

Back to top