This tutorial will get you through all the steps from the registration, getting your certificate, testing and using the Semiocast API.
You should be familiar with the cURL command line tool to run the examples below.
The following formating conventions are used through out the documentation. Inputs in the tutorial are formated as follows:
And outputs as follows:
All access to the Semiocast API methods are done with a certificate. You can download you certificate from your account page.
Certificates are available in two formats: PEM and PKCS-12.
Curl examples in this tutorial use the PEM format certificate. Be sure to download the PEM format certificate before proceeding, you will need it to test Semiocast API with curl.
Semiocast API provides 2 API methods to test your certificate and parameters formating.
Now that you have your certificate, verify that you can connect to the Semiocast API server by calling the test/null API method. This method does not return anything, it is only intended to test your certificate.
Use the following line to test your certificate, replace PASSWORD with your account password:
Be sure to use https and not plain http.
Querying this URL does not return anything, it is only intended to test the certificate only:
Now you will verify that Semiocast API is able to parse your data with the following line:
You should get the following result in JSON format:
The test/echo call returns the method called (test) and each parameter associated to its value.
Semiocast API methods support 2 formats for returning results: JSON and XML. Getting a result in one format is just a matter of specifying the extension in the API method call.
Replace the extension json by the extension xml in previous example:
And you will get the following result in XML:
Hint: a more convenient way to use curl to access Semiocast API consists to send parameters thanks to the -d option:
will return: