6 posts / 0 new
Last post
pkatiyar
Calling data platform APIs from a linux server

Hello,

I'm trying to call your data platform APIs from a linux machine (RHEL 6.2).  How to do the same?

Type: 
Public
rchoubey
Re:-Calling data platform APIs from a linux server

You can call the API's using curl commands from command line or in a shell script

pkatiyar
Re:-Calling data platform APIs from a linux server

I want to use the command line option using curl commands to call API specific URL. I do see that URL format is :-

https://api-data-platform.developer.ssni.com/{API specific string}

Can anybody help me with what to put in there for "API specific string" ?

rchoubey
Re:-Calling data platform APIs from a linux server

Below is the URL format to call API :->

https://api.data-platform.developer.ssni.com/api/solutions/<Solution Name>/devices?deviceType=humidity

This URL fetches details of devices under that solution and of type specificed. If no deviceType is specified then all devices will be returned.

Here solution name is the logical group of solution which gets created when you configure the devices e.g. sandbox and device type is a logical categorization which you must have organized earlier.

If you wish to find out various URLs to be called from command line, you can use Starfish Studio Simulation link available on developer portal to simulate and create links for various types of requests like GET, POST, UPDATE etc.

Link for Starfish Studio is:->    https://studio.developer.ssni.com/studio.html

rchoubey
Re:-Calling data platform APIs from a linux server

what’s the actual curl command to call API & display the list of all devices which i have created and how it is secure, please explain in brief ?

msharma
Re:-Calling data platform APIs from a Linux server

below is the curl command:-

curl -X GET --header 'Accept: application/json' --header 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9 'https://api.data-platform.developer.ssni.com/api/tenants/{tenantId}/solutions/{sandbox}/devices'

Note:- adding a prefix “/tenants/{tenantId}” for APIs (and tenantId is developer’s tenantId).

Calls are secured using an OAuth token (API key). A token is obtained with a Client ID and Secret API key. Your client ID and Secret can be obtained from your developer account.Once you have your Client ID and Secret, you can obtain a token by calling the "tokens" API replacing <your ClientID> and <your Secret> with the values provided through your Developer Portal account.