Skip to main content

POST - Create new point

Create new point

Request

  • Method: POST
  • Endpoint: /locations/points
  • Base URL: https://api.targpatrol.com/api/v1
  • Operation ID: create-new-point

Authorization

This endpoint requires an external API key.

x-api-key: {your_external_api_key}

Request Body

Required: yes Content-Type: application/json Schema: PointRequest

Schema
{
"$ref": "#/components/schemas/PointRequest"
}

Example: example-1

{
"locationId": "12a8af51-52f6-409b-82c2-08bbd5df18c2",
"name": "P001",
"type": "VIRTUAL",
"address": null,
"latitude": null,
"longitude": null,
"graphicPlans": [],
"rfidCode": null,
"qrCode": null,
"tags": [
"tag1"
],
"allowOnDemandCheckIn": true,
"onDemandCheckInDefaults": [
{
"actionId": "064d33e5-ddff-42b7-a3e2-80a870396cf7"
},
{
"actionId": "38c70628-870a-4b39-9492-1c23bfc3ef2e"
}
],
"onDemandCheckInUserOverrides": [
{
"actionId": "064d33e5-ddff-42b7-a3e2-80a870396cf7",
"groupName": "Employees",
"userId": "c6dd00e4-eee3-4fb2-95ba-4f53b7a61b78"
},
{
"actionId": "38c70628-870a-4b39-9492-1c23bfc3ef2e",
"groupName": "Employees",
"userId": "c6dd00e4-eee3-4fb2-95ba-4f53b7a61b78"
}
]
}

Responses

201 OK

Content-Type: application/json Schema: PointResponse

Schema
{
"$ref": "#/components/schemas/PointResponse"
}

Example: example-1

{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"locationId": "12a8af51-52f6-409b-82c2-08bbd5df18c2",
"name": "P001",
"type": "VIRTUAL",
"address": null,
"latitude": null,
"longitude": null,
"graphicPlans": [],
"rfidCode": null,
"qrCode": null,
"tags": [
"tag1"
],
"allowOnDemandCheckIn": true,
"onDemandCheckInDefaults": [
{
"actionId": "064d33e5-ddff-42b7-a3e2-80a870396cf7",
"actionOrder": 1
},
{
"actionId": "38c70628-870a-4b39-9492-1c23bfc3ef2e",
"actionOrder": 2
}
],
"onDemandCheckInUserOverrides": [
{
"actionId": "064d33e5-ddff-42b7-a3e2-80a870396cf7",
"actionOrder": 1,
"groupName": "Employees",
"userId": "c6dd00e4-eee3-4fb2-95ba-4f53b7a61b78"
},
{
"actionId": "38c70628-870a-4b39-9492-1c23bfc3ef2e",
"actionOrder": 2,
"groupName": "Employees",
"userId": "c6dd00e4-eee3-4fb2-95ba-4f53b7a61b78"
}
]
}

400 Bad request

Content-Type: application/json Schema: ErrorResponse

Schema
{
"$ref": "#/components/schemas/ErrorResponse"
}

Example: example-1

{
"message": "validation failed",
"code": "validation.failed",
"timestamp": "2023-03-07T05:57:59.315Z",
"details": [
{
"message": "must not be null",
"code": "validation.notnull.failed",
"identifier": "type"
}
]
}

401 Unauthorized

406 Not Acceptable

Content-Type: application/json Schema: ErrorResponse

Schema
{
"$ref": "#/components/schemas/ErrorResponse"
}

Example: example-1

{
"message": "mismatch in the types of content",
"code": "not.acceptable",
"timestamp": "2023-03-07T05:57:59.315Z"
}

500 Internal Server Error

Content-Type: application/json Schema: ErrorResponse

Schema
{
"$ref": "#/components/schemas/ErrorResponse"
}

Example: example-1

{
"message": "internal server error",
"code": "internal.server.error",
"timestamp": "2023-03-07T05:57:59.315Z"
}