curl --request POST \
--url https://{tenant}/api/assets \
--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": "my-template"
}'{
"ID": "my-unique-template-id",
"Message": "asset created",
"Meta": "664d86e35715ec0d370bbe11",
"Status": "success"
}Create an asset that you can use as a blueprint from which you can create a new Tyk OAS API definition.
curl --request POST \
--url https://{tenant}/api/assets \
--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": "my-template"
}'{
"ID": "my-unique-template-id",
"Message": "asset created",
"Meta": "664d86e35715ec0d370bbe11",
"Status": "success"
}Was this page helpful?