This article explains how to create client SDKs using LI API Swagger Specification.
Generating SDKs using Swagger Editor
- Copy LI API Swagger Specification from https://locate.pitneybowes.com/downloads/location-intelligence/v1/LocationIntelligenceApi_Swagger.json
- Paste the specification in Swagger Editor at https://editor.swagger.io/
- The editor will validate and show the LI APIs.
- Click on Generate Client link on the title bar in Swagger Editor and select any desired platform/Language to generate SDK.
The zipped SDK will be downloaded, which also contains a README file. Follow the README file to build the library.
Generating and Setting the OAuth Token
Curl request to generate OAuth token is:
curl -X POST https://api.pitneybowes.com/oauth/token -H "Authorization: Basic {base64Value}" -H "Content-Type: application/x-www-form-urlencoded" -d grant_type=client_credentials
For more details on generating and using OAuth token, see article Using OAuth to access Locate APIs
To set the token, read the README file from the downloaded SDK and follow the sample code example.
Refreshing the Token
Access token have limited lifetime. If the token expires, follow Step 4 in the article Using OAuth to access Locate APIs