Importing products
Cloud API has endpoints that let you import a product. The source of the product can be either an XML template or a mind map.
Use the following endpoint to import a product:
- POST
/productdefinition/v1/import-template
- POST
/productdefinition/v1/import-xmind
For most Cloud API endpoints, the request has a body with a single string of JSON text.
However, the import endpoints expect the request body to be a FormData
object, as opposed to a JSON string. The request header must have a content key whose
value is the template or mind map to import. The response contains a body with a single
id
attribute that identifies the id
of the
imported product.
Example of importing an XML template
For example, suppose you had an XML template for a PersonalAuto
product. The template is named PA-20230516.xml
. The following
request imports the template.
Command
POST /productdefinition/v1/import-template
Request header
content/PA-20230516.xml
Request body
{
"data": {
"attributes": {
"id": "PersonalAuto"
}
}
}
Example of importing a mind map
For example, suppose you had a mind map for a MarineCargo
product.
The template is named MarineCargo.xmind
. The following request
imports the mind map.
Command
POST /productdefinition/v1/import-xmind
Request header
content/MarineCargo.xmind
Request body
{
"data": {
"attributes": {
"id": "MarineCargo"
}
}
}
Import XML templates and mind maps using Postman
About this task
From Postman, you can POST XML templates and mind maps using FormData objects.