Using My Access Token
Using your Access Token to query the Datacenter's RESTful API is pretty straight forward and even easier to test using the RESTful API tool, Insomnia.
The Datacenter's API uses Authentication of type BearerToken and requires a Multipart Form when submitting data with your POST Request, such as a brochure's id or an article's id.
In the code example on the right we first setup a function called 'queryapi' that we can used again and again and simply parse the API's endpoint url and any POST data to it. In the 'queryapi' function we accept the endpoint as a string and $post variable as an 'Array'. We then check to see if the $post variable is false or has data and using PHP's curl functionality we submit the $post data on a POST Request if it exsits as an Array, otherwise we submit the $post variable as 'false' on a GET Request. The two requests are setup slightly differently depending on which request type is being called.
The function 'get_all_brochures' is a GET Request example using the resuable 'queryapi' function and simply parses the endpoint as a string and the $post variable as false.
Please feel free to copy and use the example code.
Below the example code is the result output JSON format that you will receive on successful authentication and request.