Skip to main content

Create table data

Create table data API

Endpoint

Request URL: https://usapi.hottask.com/autodev/CustomTableValue/Create/{{randomCode}}/{{customTableID}}

Method: POST

  • randomCode: The project randomCode. Example: 7qaucizgxdrb
  • customTableID: The table ID. 123
  • Example: /autodev/CustomTableValue/Create/7qaucizgxdrb/123

Request Headers

The API request must include the following headers:

  • customauth: project auth token - string, required - The secret key for authenticating the API request
  • Content-Type: application/json - string, required - The content type of the request payload (must be application/json)

Request Body

The request body should contain the following parameters:

{
// object, required - Table definition key-value pairs
"create": {
"table field definitions...": "The values here is not fixed and depends on the field definitions of the table...."
}
}
  • randomCode - string, required - The project randomCode
  • customTableID - integer, required - The table ID
  • create - object, required - Table definition key-value pairs

Example Request

JavaScript (Fetch API)

const res = await fetch('https://usapi.hottask.com/autodev/CustomTableValue/Create/{{randomCode}}/{{customTableID}}', {
method: 'POST',
headers: {
"Authorization": "<Your-Secret-Key>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"create": {
"table field definitions...": "The values here is not fixed and depends on the field definitions of the table...."
}
})
});

const data = await res.json();
console.log(data);

Python (Requests Library)

import requests
import json

url = 'https://usapi.hottask.com/autodev/CustomTableValue/Create/{{randomCode}}/{{customTableID}}'
headers = {
"Authorization": "<Your-Secret-Key>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"create": {
"table field definitions...": "The values here is not fixed and depends on the field definitions of the table...."
}
})

response = requests.post(url, headers=headers, json=data)
data = response.json()
print(data)

cURL

curl 'https://usapi.hottask.com/autodev/CustomTableValue/Create/{{randomCode}}/{{customTableID}}' \
-X POST \
-H 'Authorization: <Your-Secret-Key>' \
-H 'Content-Type: application/json' \
-d '{"create":{"table field definitions...":"The values here is not fixed and depends on the field definitions of the table...."}}'

HTTP Request

POST /autodev/CustomTableValue/Create/{{randomCode}}/{{customTableID}} HTTP/1.1
Host: usapi.hottask.com
Authorization: <Your-Secret-Key>
Content-Type: application/json

{
"create": {
"table field definitions...": "The values here is not fixed and depends on the field definitions of the table...."
}
}

Response

The API response will be a JSON object with the following structure:

{
// int - The unique identifier (ID) of the created data
"Data": 1,
// string - API version
"Version": "1.0.0",
// boolean - Operation success status
"Success": true,
// integer - HTTP status code
"Code": 200,
// string - Error message if any
"Message": ""
}

Error Handling