Przejdź do głównej zawartości

Utwórz skrypt automatyczny

POST
/api/v3/automaticScripts
curl --request POST \
--url https://twoja-instancja-ajs-api.enterprise.sellrocket.pl/api/v3/automaticScripts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "body": "example", "id": 1, "groupId": 1, "inputDataSchema": "example", "type": "AutomaticScript", "priority": 1, "delaySeconds": 1, "inputUiSchema": "example", "inputDataDefaultsScriptId": 1 }'

Tworzy nowy skrypt automatyczny. Operacja jest asynchroniczna – zwraca zadanie, którego stan sprawdzisz przez /api/jobs/get/{id}.

Script to create.

Request for creating automatic script.

object
name
wymagane

Name of the automatic script. Given by user.

string
>= 1 characters
body

Body of the automatic script. Written by user.

string
nullable
id

Id of the automatic script. Written by user.

integer format: int64
nullable
groupId

Id of the group the script belongs to

integer format: int64
inputDataSchema

The input data JSON Schema

nullable
type

Type of the script used to determine the kind of UI used for display

string
Dozwolone wartości: AutomaticScript AutomaticAction
priority

Priority of the script, the higher the number the higher the priority.

integer format: int64
delaySeconds

Delay in seconds - how long to wait before executing the script.

integer format: int64
inputUiSchema

(absent ⇒ property omitted)

nullable
inputDataDefaultsScriptId

(absent ⇒ property omitted)

integer format: int64
nullable

Success

object
id
integer format: int64
createdAt
string format: date-time
updatedAt
string format: date-time
payload
nullable
result
nullable
status
string
Dozwolone wartości: New InProgress Completed Failed
command
string
nullable

Bad Request

object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties