On this page

Getting Started

Updated on 2024-01-09 GMT+08:00

This section describes how to create predefined tags by invoking the TMS API.

NOTE:

The token obtained from IAM is valid for only 24 hours. If you want to use a token for authentication, you can cache it to avoid frequently calling the IAM API.

Involved APIs

If you use a token for authentication, you must obtain the user's token and add X-Auth-Token to the request header of the IMS API when making an API call.

  • The IAM API used to obtain the token
  • The TMS API used to create predefined tags

Procedure

  1. Obtain the token by referring to Authentication.
  2. Send POST https://TMS endpoint/v1.0/predefine_tags/action.

    Add Content-Type and X-Auth-Token to the request header.

    Specify the following parameters in the request body:
    {  
     "action": "create", //Operation (mandatory, string)
       "tags" : [ 
                  {
                       "key": "ENV1",  //Key (mandatory, string)
                       "value": "DEV1" //Value (mandatory, string)
                    }, 
                  {
                       "key" : "ENV2",
                       "value" : "DEV2"
                   }
                  ]    
    }
    After the request is sent, the status code 204 is returned and the response body is empty.
    NOTE:
    • The response message may be a success or a failure. This document takes the successful response as an example.
    • If the request fails, an error code and error information are returned. For details, see Error Codes.
    • For details about the elements and return values of response messages, see Creating or Deleting Predefined Tags.
Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback