Przejdź do głównej zawartości

Utwórz lub zaktualizuj akcję własną

PUT
/api/v4/UserEvents
curl --request PUT \
--url https://twoja-instancja-smerp-api.enterprise.sellrocket.pl/api/v4/UserEvents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "id": 1, "name": "example", "description": "example", "button": { "enabled": true, "caption": "example", "icon": "example", "color": "example", "location": [ "Order" ], "restrictions": [ { "location": "Order", "userAccountRestrictions": "None", "statusesRestrictions": "None", "stationRestrictions": "None", "userAccountsAssociations": [ 1 ], "statusesAssociations": [ 1 ] } ], "refreshPageAfterAnyScriptFinishes": true }, "shortcut": { "enabled": true, "value": "example" }, "barcode": { "enabled": true, "value": "example" }, "synchronous": true, "position": 1, "refreshPageAfterAnyScriptFinishes": true }'

Aktualizuje akcję o podanym ID lub tworzy nową. Operacja asynchroniczna – zwraca zadanie (job), którego wynik sprawdzisz w Zadaniach asynchronicznych.

Request payload

object
id
integer format: int64
nullable
name
string
nullable
description
string
nullable
button
object
enabled
boolean
caption
string
nullable
icon
string
nullable
color
string
nullable
location
Array<string>
nullable
Dozwolone wartości: Order Orders Returns Pick Pack Return
restrictions
Array<object>
nullable
object
location
string
Dozwolone wartości: Order Orders Returns Pick Pack Return
userAccountRestrictions
string
Dozwolone wartości: None ShowForSpecifiedUsers HideForSpecifiedUsers
statusesRestrictions
string
Dozwolone wartości: None ShowForSpecifiedStatuses HideForSpecifiedStatuses
stationRestrictions
string
Dozwolone wartości: None ShowOnSpecifiedStations HideOnSpecifiedStations
userAccountsAssociations
Array<integer>
nullable
statusesAssociations
Array<integer>
nullable
refreshPageAfterAnyScriptFinishes
boolean
shortcut
object
enabled
boolean
value
string
nullable
barcode
object
enabled
boolean
value
string
nullable
synchronous
boolean
nullable
position
integer format: int64
nullable
refreshPageAfterAnyScriptFinishes
boolean

Success

Typ treściapplication/json
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
scope
string
nullable
scopeValue
string
nullable
silentMode
boolean
ajsChainId
string
nullable
ajsChainVisits
string
nullable
Example
{
"status": "New"
}

Bad Request

Typ treściapplication/json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Unauthorized

Typ treściapplication/json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Server Error

Typ treściapplication/json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}