Passer au contenu principal
POST
/
public
/
v1
/
campaign-service
/
json-templates
Create Json Template
curl --request POST \
  --url https://api.topsort.com/public/v1/campaign-service/json-templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "jsonSchema": {},
  "previewScreenshot": "<string>",
  "adFormat": "banner",
  "previewUrl": "<string>"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "marketplaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "description": "<string>",
  "jsonSchema": {},
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "adFormat": "banner",
  "isArchived": false,
  "previewScreenshot": "<string>",
  "previewUrl": "<string>"
}

Autorisations

Authorization
string
header
requis

A valid API key generated in Topsort's UI.

Corps

application/json
name
string
requis

Unique name of the JSON template

Required string length: 1 - 50
description
string
requis

Description of the JSON template

Required string length: 1 - 100
jsonSchema
Jsonschema · object
requis

A JSON object that defines a schema according to draft-07 of the JSON Schema specification.

Exemple:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"title": {
"maxLength": 100,
"minLength": 1,
"type": "string"
}
},
"required": ["title"],
"type": "object"
}
previewScreenshot
string<uri> | null

Preview screenshot of the JSON template

Required string length: 1 - 2083
adFormat
enum<string> | null
défaut:banner

AdFormat this template is for

Options disponibles:
banner,
sponsored_brand
previewUrl
string<uri> | null

Preview URL of the JSON template

Required string length: 1 - 2083

Réponse

Successful Response

id
string<uuid>
requis

The ID of the JSON template

marketplaceId
string<uuid>
requis

The ID of the marketplace

name
string
requis

The name of the JSON template

description
string
requis

The description of the JSON template

jsonSchema
Jsonschema · object
requis

The JSON schema of the JSON template

createdAt
string<date-time>
requis

The creation time of the JSON template

updatedAt
string<date-time>
requis

The update time of the JSON template

adFormat
enum<string>
requis

The ad format of the JSON template

Options disponibles:
banner,
sponsored_brand
isArchived
boolean
défaut:false

Whether the JSON template is archived

previewScreenshot
string<uri> | null

Preview screenshot of the JSON template

Required string length: 1 - 2083
previewUrl
string<uri> | null

Preview URL of the JSON template

Required string length: 1 - 2083