Hi,
I am new in developing CRM application using Rollbase.
I am try to call Facebook Graph API to fetch the Page Insights Data.
All I know that I have to create a integration link field and then run a Send HTTP GET REQUEST Trigger.I want to know :
1)What URL should I provide in Integration Field?
2) How to call Trigger to run automatically?
3) How do I get the response?
4) Do I need to parse the JSOn I got in response?
5)How to save the data in Object's fields?
Thanks in advance
I am following this document but still couldn't able to understand its processing properly.
It may be easier for you to use Object Script trigger ans use server-side APIs to send HTTP request and receive response in single JavaScript code.
1) What URL should I provide in Integration Field? -> It depends on the API you want to use. I will try to provide you an example for this.
2) How to call Trigger to run automatically? -> Set the trigger timing. For Graphs API, I think it should be set to run after creating or updating the record.
3) How do I get the response? -> The response can be fetched using rbv_api.getSharedValue("ReturnStatus") and rbv_api.getSharedValue("ReturnBody"). However, this must be called within a trigger (after the Send GET Request).
4) Do I need to parse the JSON I got in response? -> Yes, it is necessary to fetch the specific result parameters of the request. You can use rbv_api.stringToJson() to make the parsing easier.
5) How to save the data in Object's fields? -> After getting and parsing the response, rbv_api.setFieldValue() or rbv_api.updateRecord() API can be used to set the results to the object's fields.