Wywołaj skrypt jako funkcję HTTP (POST)
POST
/api/v1/automaticScripts/{id}/runAsHttpFunction
const url = 'https://twoja-instancja-ajs-api.enterprise.sellrocket.pl/api/v1/automaticScripts/1/runAsHttpFunction';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"additionalProperty":{}}'};
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/v1/automaticScripts/1/runAsHttpFunction \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "additionalProperty": {} }'Uruchamia skrypt automatyczny jak endpoint HTTP i przekazuje mu treść żądania (JSON). Pozwala wywoływać skrypty z zewnętrznych systemów, np. jako odbiorcę webhooków.
Autoryzacja
Dział zatytułowany „Autoryzacja”Parametry
Dział zatytułowany „Parametry”Parametry ścieżki
Dział zatytułowany „Parametry ścieżki”id
wymagane
integer format: int64
Id of the script to start.
Treść żądania
Dział zatytułowany „Treść żądania”Parameters of the run. They will be passed to the script in object with name data.
object
key
additional properties
object
options
object
propertyNameCaseInsensitive
boolean
parent
object
object recursive
root
object
object recursive
Examplegenerated
{ "additionalProperty": {}}object
key
additional properties
object
options
object
propertyNameCaseInsensitive
boolean
parent
object
object recursive
root
object
object recursive
Examplegenerated
{ "additionalProperty": {}}object
key
additional properties
object
options
object
propertyNameCaseInsensitive
boolean
parent
object
object recursive
root
object
object recursive
Examplegenerated
{ "additionalProperty": {}}Odpowiedzi
Dział zatytułowany „Odpowiedzi”Success
integer format: int64
integer format: int64
Examplegenerated
1integer format: int64
Examplegenerated
1Bad Request
object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}
