Using the RightDocs API
HURIDOCS has developed an API (application programming interface) for the RightDocs application. This API allows other applications to make requests for resources and data using the JSON format (a cross-platform data structure that is both machine usable and human readable).
What is an API? An API is a set of predefined rules and specifications that a software application can follow to use the services and resources provided by another software application. In other words, an API is a kind of communication channel through which two separate applications can communicate with each other and share each others’ services and resources. In this case it means, with the API you can build your own website integrating RightDocs data.
For example, the RADAR application is using the RightDocs API to get data on UN Human Rights Council resolutions on Asian countries from the RightDocs application and display it on the RADAR website
RightDocs API is publicly available, meaning it is openly accessible requiring no user authentication to access the data.
How to use the RightDocs API
If you are interested in accessing the API in JSON format, simply add "&api=1" to the URL of any query on RightDocs.
For example, here is the RightDocs URL to access all resolutions for which Denmark is a main sponsor that were adopted by a vote: https://www.right-docs.org/?sp=454&vt=147. To pull this data into another application, simply add "&api=1" to the end of the URL so it reads: https://www.right-docs.org/?sp=454&vt=147&api=1. This is called the API end-point.
It is also possible to add a pagination parameter to your API end-point which can be helpful because you cannot return all of the data in this collection with one single API call. To give you an example of how this work, here is the RightDocs URL that displays the first page of the complete dataset: https://www.right-docs.org.
To pull this data into another application, we add "&api=1" to the end of the URL so it reads:https://www.right-docs.org/?api=1. To get only the data that is listed on page 2, you can add a pagination parameter "p=2" to the API end-point: https://www.right-docs.org/?api=1&p=2. You would add "p=3" for the third page dataset and so forth.
Below is a screenshot to exemplify the JSON response from the URL https://www.right-docs.org/?api=1. You can see the same information by putting this URL into an internet browser. Another application will be able to receive the data being requested from RightDocs using the API as illustrated.