We recommend using the free tool Postman for accessing the City API (CNAPI2, pronounced 'canopy two'). The tool can be downloaded at https://www.getpostman.com/downloads/.
Once you have Postman installed, you'll have a blank workspace:
You'll need to import the Exaptive CNAPI2 Postman collection and Postman environments. Click on the link below to go to our postman documentation portal.
On the Postman documentation page, click the "Run in Postman" button on the top-right corner of the screen. This will download and import both the collection and environment directly into your local Postman workspace:
After the files have been imported, you should have the CNAPI2 collection in your workspace menu on the left, and the blank CNAPI2 environment file in the environment dropdown list in the upper right:
Now you'll need to configure your environment files to point to your city, and to contain the correct authentication credentials. Select the CNAPI2 Environment from the dropdown in the upper right, and click on the eye icon to inspect the environment variables. Edit the current value fields to set the api field to the top-level url for your city, and add the city-UUID provided by your city administrator. Set the email and password fields with the credentials for your account:
Note that this guide focuses on authenticating with your username and password. If you were given an API key with specific permissions, you can skip the rest of the steps outlined in this guide. Instead, edit your environment so that the "use-api-key" variable is set to "true" and you fill in the "api-key" variable with your key:
Now test out each environment configuration to make sure you can successfully authenticate. There is an 'Authentication' folder at the top-level of the Postman CNAPI2 collection. Select the 'Login' method:
Click the 'Send' button. You should get a JSON return payload back with a 'success' status:
- If you are authenticating to a city already populated with data, continue directly to the Reading Data with CNAPI2 Guide.
- If you are authenticating to an empty city or want to learn how to add more data to a populated city, continue to the Writing Data with CNAPI2 Guide.