Skip to main content
POST
/
plan-items
/
v1
/
ad
/
drawing
Create a drawing plan item
curl --request POST \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/plan-items/v1/ad/drawing \
  --header 'Authorization: Bearer <token>' \
  --header 'content-type: <content-type>' \
  --header 'x-session-token: <x-session-token>' \
  --data '
{
  "planId": 1,
  "color": "#FF0000",
  "width": 2,
  "opacity": 0.5,
  "points": [
    [
      1,
      1
    ],
    [
      2,
      2
    ]
  ]
}
'
{
  "data": {
    "id": 1,
    "name": "Plan Item 1",
    "type": 1,
    "entityType": 1,
    "xPercent": 1,
    "yPercent": 1,
    "planId": 1,
    "updatedAt": "2024-12-01T12:34:56.000Z",
    "createdAt": "2024-12-01T12:34:56.000Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-session-token
string
required

Session token used for authenticating the request.

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTY3ODkwIiwic2Vzc2lvbklkIjoiYWJjZGVmMTIzNDU2IiwiaWF0IjoxNjA1MDk3ODk5LCJleHAiOjE2MDUxODQyOTl9.4XRQ1iXDyvEj5LgPZHbmTmzOZs98M3YPOzgf3MhxjaI"

content-type
string
required

Content type, must be "application/json".

Allowed value: "application/json"

Body

application/json
planId
number
required

The id of the plan that the plan item belongs to

Example:

1

color
string
required

The color of the plan item in hex format

Maximum string length: 8
Example:

"#FF0000"

width
number
required

The width of the plan item border

Required range: -3.4028234663852886e+38 <= x <= 3.4028234663852886e+38
Example:

2

opacity
number
required

The opacity of the plan item

Required range: -3.4028234663852886e+38 <= x <= 3.4028234663852886e+38
Example:

0.5

points
tuple[]
required

The rect point of the plan item

Minimum array length: 2
Example:
[[1, 1], [2, 2]]

Response

201 - application/json

Plan item created

data
object
required