Connector API
Search…
Commands

Get all commands

Returns all commands the are still active from the client application point of view. That means commands that are in either Pending or Received state.

Request

[PlatformAddress]/api/connector/v1/commands/getAllActive
1
{
2
"ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
3
"AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
4
"Client": "Sample Client 1.0.0",
5
}
Copied!
Property
Type
Contract
Description
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.

Response

1
{
2
"Commands": [
3
{
4
"Id": "aa20961f-6d9e-4b35-ad25-071213530aec",
5
"State": "Pending",
6
"CreatedUtc": "2015-09-02T19:25:44Z",
7
"Creator": {
8
"FirstName": "Sample",
9
"LastName": "User",
10
"ImageUrl": "..."
11
},
12
"Device": {
13
"Id": "63efb573-fc58-4065-b687-9bdd51568529",
14
"Name": "Test Printer",
15
"Type": "Printer"
16
},
17
"Data": {
18
"CopyCount": 1,
19
"FileType": "application/pdf",
20
"FileData": "...",
21
"PrinterName": "Printer",
22
"PrinterDriverName": "",
23
"PrinterPortName": ""
24
}
25
}
26
]
27
}
Copied!
Property
Type
Contract
Description
Commands
array of Command
required
The active commands.

Command

Property
Type
Contract
Description
Id
string
required
Unique identifier of the command.
State
string Command state
required
State of the command.
CreatedUtc
string
required
Creation date and time of the command.
Creator
User
optional
Creator of the command.
Device
Device
required
Device that the command should be executed on.
Data
object
required
Structure of the object depends on Device type.

Command state

  • Pending - Created in Mews, but not yet received by the client application.
  • Received - Received by the client application.
  • Processing - Being processed by the client application.
  • Processed - Successfully processed command.
  • Cancelled - A command whose execution has been canceled before (or during) processing.
  • Error - A command whose execution or processing was terminated by an error.

User

Property
Type
Contract
Description
FirstName
string
optional
First name of the user.
LastName
string
required
Last name of the user.
ImageUrl
string
optional
URL of the profile image.

Command data

Printer command data

Property
Type
Contract
Description
CopyCount
number
required
Number of copies to be printed.
FileType
string
required
MIME type of the file to be printed (e.g. application/pdf).
FileData
string
required
Base64-encoded data of the file to be printed.
PrinterName
string
required
Name of the printer.
PrinterDriverName
string
required
Name of the printer driver.
PrinterPortName
string
required
Name of the printer port.

Payment terminal command data

Property
Type
Contract
Description
PaymentTerminalId
string
required
Identifier of the payment terminal.
CustomerId
string
required
Identifier of the Customer.
BillId
string
optional
Identifier of the Bill.
Amount
required
Amount to be processed.
PaymentTerminalData
string
optional
Custom JSON data.

Passport scanner command data

Property
Type
Contract
Description
PassportScannerId
string
optional
Identifier of the passport scanner.
CustomerId
string
optional
Unique identifier of the Customer who should be processed.
ReservationId
string
optional
Unique identifier of the Reservation whose companions should be processed.

Fiscal machine command data

Property
Type
Contract
Description
FiscalMachineId
string
optional
Identifier of the fiscal machine.
FiscalMachineData
string
optional
Custom JSON data.
ApiUrl
string
optional
URL of the fiscal machine API.
Bill
Bill
required
The issued bill that should be fiscalized.
TaxIdentifier
string
optional
Tax identifier to be used for fiscalization.

Key cutter command data

Property
Type
Contract
Description
KeyCutterId
string
optional
Identifier of the key cutter.
KeyCutterData
string
optional
Custom JSON data.
ApiUrl
string
optional
URL of the key cutter server API.
ReservationId
string
optional
Unique identifier of the Reservation.
ReservationNumber
string
optional
Confirmation number of the reservation in Mews.
StartUtc
string
required
Reservation start.
EndUtc
string
required
Reservation end.
FirstName
string
optional
First name of the reservation owner.
LastName
string
required
Last name of the reservation owner.
Telephone
string
optional
Telephone of the reservation owner.
Email
string
optional
Email of the reservation owner.
KeyCount
number
required
Count of keys to cut.
LockIds
array of string
required
Identifiers of locks/rooms the key should open.

Get all commands by ids

Returns all commands by their identifiers.

Request

[PlatformAddress]/api/connector/v1/commands/getAllByIds
1
{
2
"ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
3
"AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
4
"Client": "Sample Client 1.0.0",
5
"CommandIds": [
6
"aa20961f-6d9e-4b35-ad25-071213530aec"
7
]
8
}
Copied!
Property
Type
Contract
Description
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.
CommandIds
array of string
required, max 1000 items
Unique identifiers of Commands to be returned.

Response

Same structure as in Get all commands operation.

Add printer command

Adds a new printer command representing printing of the specified document on a printer.

Request

[PlatformAddress]/api/connector/v1/commands/addPrinter
1
{
2
"ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
3
"AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
4
"Client": "Sample Client 1.0.0",
5
"PrinterId": "d117866d-78de-4459-9077-42d7ea0120e3",
6
"CopyCount": 1,
7
"Data": "JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxvZwogIC9QYWdlcyAyIDAgUgo+PgplbmRvYmoKCjIgMCBvYmoKPDwKICAvVHlwZSAvUGFnZXMKICAvTWVkaWFCb3ggWyAwIDAgMjAwIDIwMCBdCiAgL0NvdW50IDEKICAvS2lkcyBbIDMgMCBSIF0KPj4KZW5kb2JqCgozIDAgb2JqCjw8CiAgL1R5cGUgL1BhZ2UKICAvUGFyZW50IDIgMCBSCiAgL1Jlc291cmNlcyA8PAogICAgL0ZvbnQgPDwKICAgICAgL0YxIDQgMCBSIAogICAgPj4KICA+PgogIC9Db250ZW50cyA1IDAgUgo+PgplbmRvYmoKCjQgMCBvYmoKPDwKICAvVHlwZSAvRm9udAogIC9TdWJ0eXBlIC9UeXBlMQogIC9CYXNlRm9udCAvVGltZXMtUm9tYW4KPj4KZW5kb2JqCgo1IDAgb2JqICAlIHBhZ2UgY29udGVudAo8PAogIC9MZW5ndGggNDQKPj4Kc3RyZWFtCkJUCjcwIDUwIFRECi9GMSAxMiBUZgooSGVsbG8sIHdvcmxkISkgVGoKRVQKZW5kc3RyZWFtCmVuZG9iagoKeHJlZgowIDYKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDEwIDAwMDAwIG4gCjAwMDAwMDAwNzkgMDAwMDAgbiAKMDAwMDAwMDE3MyAwMDAwMCBuIAowMDAwMDAwMzAxIDAwMDAwIG4gCjAwMDAwMDAzODAgMDAwMDAgbiAKdHJhaWxlcgo8PAogIC9TaXplIDYKICAvUm9vdCAxIDAgUgo+PgpzdGFydHhyZWYKNDkyCiUlRU9G"
8
}
Copied!
Property
Type
Contract
Description
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.
PrinterId
string
required
Uniqque identifier of the Printer Device where to print the document.
CopyCount
int
required
Count of copies to be printed.
Data
string
required
Base64 encoded data of PDF document to print.

Response

1
{
2
"CommandId": "588fc010-1971-4589-b39f-9550d1e1b3a7"
3
}
Copied!
Property
Type
Contract
Description
CommandId
string
required
Unique identifier of the created Command.

Add key cutter command

Adds a new key cutter command representing cutting of a key for the specified reservation.

Request

[PlatformAddress]/api/connector/v1/commands/addKeyCutter
1
{
2
"ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
3
"AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
4
"Client": "Sample Client 1.0.0",
5
"KeyCutterId": "7dafffff-a727-4917-a203-bd53995f21bf",
6
"ReservationId": "be35b39e-ad7e-460a-8de9-4c7581e016a2",
7
"KeyCount": 1
8
}
Copied!
Property
Type
Contract
Description
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.
KeyCutterId
string
required
Unique identifier of the KeyCutter Device where to encode the key.
ReservationId
string
required
Unique identifier of the Reservation to encode the key for.
KeyCount
int
required
Count of keys to encode.

Response

1
{
2
"CommandId": "4a787fce-a881-4f40-8c97-bc97a6ef4ee8"
3
}
Copied!
Property
Type
Contract
Description
CommandId
string
required
Unique identifier of the created Command.

Update command

Updates state of a command.

Request

[PlatformAddress]/api/connector/v1/commands/update
1
{
2
"ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
3
"AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
4
"Client": "Sample Client 1.0.0",
5
"CommandId": "aa20961f-6d9e-4b35-ad25-071213530aec",
6
"State": "Processed"
7
}
Copied!
Property
Type
Contract
Description
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.
CommandId
string
required
Identifier of the Command to be updated.
State
string Command state
required
New state of the command.
Progress
number
optional
Progress of the command processing. Only used if the State is Processing, otherwise ignored.
Notes
string
optional
Notes about command execution. Only used if the State is Processed, Cancelled or Error, otherwise ignored.

Response

1
{}
Copied!