Description
Use a HTTP POST request to create a HTTP Request user credential.
Request
HTTP Method: POST
Parameter | Description |
---|---|
name | Name of the user credential. |
mode | Describes the type of credential (HTTP_REQUEST_AGENT ) |
team_id | ID of Tines Team where the user credential will be located. |
folder_id | Optional ID of folder to which the user credential will be located |
http_request_options | JSON string representing the Agents::HTTPRequestAgent Options |
http_request_location_of_token | Location of token from response |
Sample request
curl -X POST \
https://<tenant-name>.tines.io/api/v1/user_credentials \
-H 'content-type: application/json' \
-H 'x-user-email: <email-address>' \
-H 'x-user-token: <api-token>' \
-d '{
"name": "foo",
"value": "bar",
"mode": "HTTP_REQUEST_AGENT",
"team_id": 2,
"http_request_options": "{\"url\":\"http://www.example.com\",\"content_type\":\"json\",\"method\":\"post\",\"payload\":{\"key\":\"value\",\"something\":\"the event contained \"},\"headers\":{}}",
"http_request_location_of_token": "",
}'
Response
A successful request will return a JSON object describing the created credential.
Field description
Parameter | Description |
---|---|
id | User credential ID. |
name | Name of the user credential. |
mode | Describes the type of credential (TEXT, JWT, OAUTH, AWS, MTLS, HTTP_REQUEST_AGENT ) |
team_id | ID of team to which the user credential belongs. |
folder_id | ID of folder to which the user credential belongs. |
created_at | ISO 8601 Timestamp representing date and time the credential was created. |
updated_at | ISO 8601 Timestamp representing date and time the credential was last updated. |
Sample response
{
"id": 1,
"name": "tines_api_credential",
"mode": "HTTP_REQUEST_AGENT",
"team_id": 2,
"folder_id": 1,
"created_at": "2021-03-26T12:34:16.540Z",
"updated_at": "2021-03-26T12:34:16.540Z"
}