To use the CartoVista server REST API, you must first create an API key.
CartoVista has a server API that will allow you to automate any of your actions on the server, such as loading a dataset, modifying a dataset or part of a dataset, deleting an object on the server, etc.
CartoVista API is based on REST principles. API calls are made through HTTP requests, using the following standard methods: GET, POST, DELETE, PATCH.
Here are the steps to follow to create an API Key.
- Go to the User page in the CartoVista Server:
- Select your user, go to API Key and select Add Key:
- Enter your external IP address in the dialogue window and click Add API Key:
- Your API Key is now available in your user profile:
Copy and paste it to the apiKey header of your requests to enable your requests. The apiKey parameter can also be passed as a query string parameter.
ℹ️ API Keys are linked to external IP addresses. You will therefore need to make the API calls from the computer which IP you registered. It is possible to register multiple external IP addresses for one single API Key. Simply list the IPs separated by a semicolon:
If want to avoid using IP Address whitelisting, you can create a generate a secret key. The secret key is only visible temporarily on the server, and you will have to regenerate it you don't save it elsewhere. Add a secretKey header to your requests to use it.
Click on the Generate Secret Key button to generate a secret key:
Your temporary secret key will then be visible just below your permanent Access Key:
It will disappear once you leave the information panel.