Keywords Creation
This function allows to create a keyword in the system. The request must be made with a POST method.
URL: /admin/jsapi/tkeyword?op=a
Mandatory parameters:
- nombre: keyword name
- clave_tag: identifier used in tags to send the keyword value to e-planning
- tipo: type
1: Integer
2: Decimal number
3: Text
4: Options list
5: Data Table
6: Geographic coordinates
If type is:
- Options list: list of options separated by commas. Ex.: hello, test
- Data table: .CSV (comma-separated and in utf8 format) with two columns: ID + description
- sitio_id: list of the linked sites, sites ids separated by space. Ex.: 76721 64937 73491 > Indicate at least 1 asociated site so as to create the kw.
Optional paramaters:
- persistent: 1 o 0
.nvalues: Number of saved values
.timeout: Expiration days (0 to 18)
Response:
It contains an object indicating the generated ID and a status object that indicates the state of the result; in this case “200” means that it was created successfully.
If the operation fails, by the errors object, if shows a list of errors indicating:
- An attribute that shows each failed field
- The value of each attribute with the corresponding error message.
It also contains a status object that indicates the state of the result, in this case “400”.
Response example with errors
{'errors':{'clave_tag':'ERROR_VALOR_DUPLICADO','nombre':'ERROR_NOMBRE_DUPLICADO'},'status':400} |
Response example without errors
{'tkeyword_id':'241','status':200} |