Creating an Export
Our APIs are not just for viewing data, you can also create data with mutations.
For these examples you will need to substitute your own Plan IDs.
The easiest way to try these APIs is to use the API Explorer. This has useful features like autocomplete (ctrl+space) and query/input validation.
Here the createExport mutation takes an input of planId
and parameters
. In parameters only the layer
is required.
This will create the export and then query for the exports id in the response:
You can then use the steps in Fetching Exports to check on the status of that export.
Using Variables
As the input gets more complex you will want to use GraphQL variables. For some background information on Variables in Mutations, see here.
To take the query above and use variables you need to do 3 things:
Define the variable in the mutation signature:
mutation($input:CreateExportInput!){
Use the defined variable in the mutation:
createExport(input:$input){
Define the value of the variable in the
variables
section of the JSON payload
This transforms the query to the following:
With the variables:
The raw request looks like:
Last updated