ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 1 reply, has 2 voices, and was last updated by  nino.fischer 2 years, 2 months ago.

  • Creator
    Topic
  • #11583

    Hung
    Participant

    Hi guys !

    I am calling search rest API and i got this result

    {“records_count”:1,”count”:1,”data”:[{“entity_name”:”OroCRM\\Bundle\\ContactBundle\\Entity\\Contact”,”record_id”:2,”record_string”:”Hung Luu”,”record_url”:”http:\/\/dev.crm.local.info\/contact\/view\/2″}]}

    when i call json_decode it return nothing , can you please let me know what is going on ? even it is a valid JSON http://jsonviewer.stack.hu/

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #11896

    nino.fischer
    Participant

    Hi Hung!

    I encountered the same issue as you did.
    In my case, i wanted to show a list of all leads of mine.
    In php i used the Guzzle-Client.

    Maybe my code will help you answering your question:


    //the Request is an instance of the Guzzle-Client, with set options (connection-parameters)
    $response = $request->send();
    $responseSTR = trim($response->getBody(),"[]");
    $output->write($responseSTR);

    As you can see, I trimmed the response-body by these brazelets.
    For me this did all the magic.

    I hope I could help you in some way.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.