Configuring mapping tables in Management API
This article explains how to list all mapping tables in a given workspace, how to list and edit mapping entries, and how to update or delete mapping entries with the Management API.
Listing mapping tables
To list all mapping tables present in your Adverity instance, follow these steps:
-
Create a GET request to the following endpoint:
https://{{INSTANCE}}/api/mapping-tables
-
In the HTTP request header, include the parameter
Authorization
with valueToken {{TOKEN}}
. -
Send the request.
Import the request example as raw text to your HTTP client (such as Postman). The cURL request example is the following:
curl --location -g --request GET 'https://{{INSTANCE}}/api/mapping-tables/' \
--header 'Authorization: Token {{TOKEN}}'
Listing mapping table entries
To list entries of a specific mapping table, follow these steps:
-
Create a GET request to the following endpoint:
https://{{INSTANCE}}/api/mapping-tables/{{MAPPING_TABLE_ID}}/entries/
Use
MAPPING_TABLE_ID
from the API response described in the previous section. -
In the HTTP request header, include the parameter
Authorization
with valueToken {{TOKEN}}
. -
Send the request.
Import the request example as raw text to your HTTP client (such as Postman). The cURL request example is the following:
curl --location -g --request GET 'https://{{INSTANCE}}/api/mapping-tables/{{MAPPING_TABLE_ID}}/entries/' \
--header 'Authorization: Token {{TOKEN}}'
Creating a new mapping table entry
To create a new mapping table entry, follow these steps:
-
Create a POST request to the following endpoint:
https://{{INSTANCE}}/api/mapping-tables/{{MAPPING_TABLE_ID}}/entries/
-
In the HTTP request header, include the parameter
Authorization
with valueToken {{TOKEN}}
. -
In the HTTP request header, include the parameter
Content-Type
with valueapplication/json
. -
In the HTTP request body, include the parameter
match
with the source value and parametervalue
with the target value. For more information on source and target values in mapping tables, see Creating and applying mapping tables. -
Send the request.
-
In the response, you receive the
entry_id
of the newly added mapping table entry. You can list it again with the call described in the previous section.
Import the request example as raw text to your HTTP client (such as Postman). The cURL request example is the following:
curl --location -g --request POST 'https://{{INSTANCE}}/api/mapping-tables/{{MAPPING_TABLE_ID}}/entries/' \
--header 'Authorization: Token {{TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"match": "SOURCE_VALUE"
"value": "TARGET_VALUE"
}'
Updating a mapping table entry
To update a mapping table entry, follow these steps:
-
Create a PATCH request to the following endpoint:
https://{{INSTANCE}}/api/mapping-tables/{{MAPPING_TABLE_ID}}/entries/{{ENTRY_ID}}/
-
In the HTTP request header, include the parameter
Authorization
with valueToken {{TOKEN}}
. -
In the HTTP request header, include the parameter
Content-Type
with valueapplication/json
. -
In the HTTP request body, include the
match
orvalue
parameters and their respective values to edit. For example, for the parametervalue
, change the valuecomputer
todesktop
.{ "value": "UPDATED_VALUE" }
-
Send the request.
Import the request example as raw text to your HTTP client (such as Postman). The cURL request example is the following:
curl --location -g --request PATCH 'https://{{INSTANCE}}/api/mapping-tables/{{MAPPING_TABLE_ID}}/entries/{{ENTRY_ID}}/' \
--header 'Authorization: Token {{TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"value": "UPDATED_VALUE"
}'
Deleting a mapping table entry
To delete a mapping table entry, follow these steps:
-
Create a DELETE request to the following endpoint:
https://{{INSTANCE}}/api/mapping-tables/{{MAPPING_TABLE_ID}}/entries/{{ENTRY_ID}}/
-
In the HTTP request header, include the parameter
Authorization
with valueToken {{TOKEN}}
. -
Send the request.
Import the request example as raw text to your HTTP client (such as Postman). The cURL request example is the following:
curl --location -g --request DELETE 'https://{{INSTANCE}}/api/mapping-tables/{{MAPPING_TABLE_ID}}/entries/{{ENTRY_ID}}/' \
--header 'Authorization: Token {{TOKEN}}'