Utwórz skrypt automatyczny
const url = 'https://twoja-instancja-ajs-api.enterprise.sellrocket.pl/api/v3/automaticScripts';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","body":"example","id":1,"groupId":1,"inputDataSchema":"example","type":"AutomaticScript","priority":1,"delaySeconds":1,"inputUiSchema":"example","inputDataDefaultsScriptId":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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}.
Autoryzacja
Dział zatytułowany „Autoryzacja”Treść żądania
Dział zatytułowany „Treść żądania”Script to create.
Request for creating automatic script.
object
Name of the automatic script. Given by user.
Body of the automatic script. Written by user.
Id of the automatic script. Written by user.
Id of the group the script belongs to
The input data JSON Schema
Type of the script used to determine the kind of UI used for display
Priority of the script, the higher the number the higher the priority.
Delay in seconds - how long to wait before executing the script.
(absent ⇒ property omitted)
(absent ⇒ property omitted)
Request for creating automatic script.
object
Name of the automatic script. Given by user.
Body of the automatic script. Written by user.
Id of the automatic script. Written by user.
Id of the group the script belongs to
The input data JSON Schema
Type of the script used to determine the kind of UI used for display
Priority of the script, the higher the number the higher the priority.
Delay in seconds - how long to wait before executing the script.
(absent ⇒ property omitted)
(absent ⇒ property omitted)
Request for creating automatic script.
object
Name of the automatic script. Given by user.
Body of the automatic script. Written by user.
Id of the automatic script. Written by user.
Id of the group the script belongs to
The input data JSON Schema
Type of the script used to determine the kind of UI used for display
Priority of the script, the higher the number the higher the priority.
Delay in seconds - how long to wait before executing the script.
(absent ⇒ property omitted)
(absent ⇒ property omitted)
Odpowiedzi
Dział zatytułowany „Odpowiedzi”Success
object
object
Example
{ "status": "New"}object
Example
{ "status": "New"}Bad Request
object
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}
