Question

Photo of Brst Dev

0

Problem fetching data from Rock

Hello Support,

I am working on a wordpress website to fetch the data from Rock RMS https://www.rockrms.com/ . I have gone through the documentation but I am not able to successfully integrate the apis.

First I have tried to authenticate login through hurl.it and it is giving me response http://prntscr.com/ai1aq6 . and it is returning a cookie that can be seen at bottom in screenshot. Now I want to fetch categories using http://rock.rocksolidchurchdemo.com/api/categories but it giveing error http://prntscr.com/ai1h6d
please suggest what I am missing

Thanks in advance!

  • Photo of Daniel Boorn

    1

    The Auth response will return a "Set-Cookie" response with the ".ROCK" cookie. You'll need to cache the ".ROCK" cookie after the authentication request and provide it to the API as a "Cookie: .ROCK..." header for authentication. In PHP you can do this using PHP streams using a stream context (http://php.net/manual/en/function.stream-context-create.php) to set the header. Alternatively you may also use cURL and the CURLOPT_HTTPHEADER option header. You may also use some prebuilt packages for consuming the API with PHP (https://github.com/deboorn/rockrmsapi). 

    Since the API is REST you'll want to use the GET verb to fetch categories and POST for creating a new category. Please let me know if you have any other API questions. Happy to help.

  • Photo of Jim Michael

    0

    Knowing nothing about the API, I can't answer your specific question. But I can suggest that you join the Rock Slack team if you haven't already: http://www.rockrms.com/slack

    Slack is a venue that is more suited to real-time chat which can be useful for solving problems like this, and you can often interact with Rock devs more directly that way. That said, if you do get your answer solved there, please post the solution back here to keep the QA accurate, since slack data is temporary and the QA is more of a permanent archive.

  • Photo of Brst Dev

    0

    Hello Jim,

    Thanks for the response I will try with Slack and see if things works. I have worked on many other apis integration but facing problems with Rock

    Thanks!

  • Photo of Bronson Witting

    0

    Here is a great resource for learning the Rock API:  http://www.rockrms.com/page/513?Item=80