Utwórz lub zastąp skrypt automatyczny
const url = 'https://twoja-instancja-ajs-api.enterprise.sellrocket.pl/api/v3/automaticScripts/1';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","body":"example","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 PUT \ --url https://twoja-instancja-ajs-api.enterprise.sellrocket.pl/api/v3/automaticScripts/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "body": "example", "groupId": 1, "inputDataSchema": "example", "type": "AutomaticScript", "priority": 1, "delaySeconds": 1, "inputUiSchema": "example", "inputDataDefaultsScriptId": 1 }'Tworzy skrypt o podanym identyfikatorze lub nadpisuje istniejący. Operacja asynchroniczna – zwraca zadanie.
Autoryzacja
Dział zatytułowany „Autoryzacja”Parametry
Dział zatytułowany „Parametry”Parametry ścieżki
Dział zatytułowany „Parametry ścieżki”Id of the automatic script to update.
Treść żądania
Dział zatytułowany „Treść żądania”Automatic script to create or update.
Request for updating the automatic script.
object
Name of the automatic script. Given by user.
Body of the automatic script. Written by user.
The 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 updating the automatic script.
object
Name of the automatic script. Given by user.
Body of the automatic script. Written by user.
The 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 updating the automatic script.
object
Name of the automatic script. Given by user.
Body of the automatic script. Written by user.
The 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"}
