curl --request PUT \
--url https://{tenant}/api/assets/{assetID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"info": {
"title": "Our Sample OAS",
"version": "1.0.0"
},
"openapi": "3.0.3",
"paths": {
"/anything": {
"post": {
"operationId": "anythingpost",
"responses": {
"200": {
"description": "post created"
}
}
}
}
},
"x-tyk-api-gateway": {
"middleware": {
"global": {
"cache": {
"cacheAllSafeRequests": true,
"enabled": true,
"timeout": 5
}
}
}
}
},
"description": "My first template",
"id": "my-unique-template-id",
"kind": "oas-template",
"name": "Update asset name example."
}'{
"ID": "my-unique-template-id",
"Message": "asset updated",
"Meta": "664d86e35715ec0d370bbe11",
"Status": "success"
}Update an asset by ID.You cannot update _id (database ID assigned by tyk)
curl --request PUT \
--url https://{tenant}/api/assets/{assetID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"info": {
"title": "Our Sample OAS",
"version": "1.0.0"
},
"openapi": "3.0.3",
"paths": {
"/anything": {
"post": {
"operationId": "anythingpost",
"responses": {
"200": {
"description": "post created"
}
}
}
}
},
"x-tyk-api-gateway": {
"middleware": {
"global": {
"cache": {
"cacheAllSafeRequests": true,
"enabled": true,
"timeout": 5
}
}
}
}
},
"description": "My first template",
"id": "my-unique-template-id",
"kind": "oas-template",
"name": "Update asset name example."
}'{
"ID": "my-unique-template-id",
"Message": "asset updated",
"Meta": "664d86e35715ec0d370bbe11",
"Status": "success"
}Was this page helpful?