Synology DS418 Transactions in Surveillance Station 8.1.0 and above - Page 31

API error code, Examples, Operation failed, Transactions, Add-ons, Surveillance Station

Page 31 highlights

Send Transactions Using WebAPI API error code Code 400 401 Description Operation failed Illegal parameters Operation failed means the system is in an abnormal status. Please confirm that the Transactions service is enabled in the Add-ons application. If the service has been enabled, please try to restart Surveillance Station. Several reasons can cause Illegal parameters, here are some common reasons listed as follows: • Incomplete or invalid parameters. • Tried to append, complete, or cancel a session before it started. • The sessionId does not match any existing sessions. • The deviceName is not found in Surveillance Station. • The timestamp of AppendData, Complete, or Cancel is less than the timestamp of Begin in one of the sessions. Examples • Start a transaction: http://192.168.2.3:5000/WebAPI/entry.cgi?api=SYNO.SurveillanceStation. Transactions.Transaction&method="Begin"&version=2&deviceName="POS01"&sessionId="1 "&timeout=300 • Append data: http://192.168.2.3:5000/WebAPI/entry.cgi?api=SYNO.SurveillanceStation. Transactions.Transaction&method="AppendData"&version=2&deviceName="POS01"&sessio nId="1"&content="Start\n2017/01/01" • Append data: http://192.168.2.3:5000/WebAPI/entry.cgi?api=SYNO.SurveillanceStation. Transactions.Transaction&method="AppendData"&version=2&deviceName="POS01"&sessio nId="1"&content="Pen $40\nBook $300" • Append data: http://192.168.2.3:5000/WebAPI/entry.cgi?api=SYNO.SurveillanceStation. Transactions.Transaction&method="AppendData"&version=2&deviceName="POS01"&sessio nId="1"&content="Total $340\nEnd" • Complete a transaction: http://192.168.2.3:5000/WebAPI/entry.cgi?api=SYNO. SurveillanceStation.Transactions.Transaction&method="Complete"&version=2&deviceName ="POS01"&sessionId="1" 30

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35

30
Send Transactions Using WebAPI
API error code
Code
Description
400
Operation failed
401
Illegal parameters
Operation failed
means the system is in an abnormal status. Please confirm that the
Transactions
service is enabled in the
Add-ons
application. If the service has been enabled,
please try to restart
Surveillance Station
.
Several reasons can cause
Illegal parameters
, here are some common reasons listed as
follows:
• Incomplete or invalid parameters.
• Tried to append, complete, or cancel a session before it started.
• The
sessionId
does not match any existing sessions.
• The
deviceName
is not found in
Surveillance Station
.
• The
timestamp
of AppendData, Complete, or Cancel is less than the timestamp of Begin in
one of the sessions.
Examples
Transactions.Transaction&method="Begin"&version=2&deviceName="POS01"&sessionId="1
"&timeout=300
Transactions.Transaction&method="AppendData"&version=2&deviceName="POS01"&sessio
nId="1"&content="Start\n2017/01/01"
Transactions.Transaction&method="AppendData"&version=2&deviceName="POS01"&sessio
nId="1"&content="Pen $40\nBook $300"
Transactions.Transaction&method="AppendData"&version=2&deviceName="POS01"&sessio
nId="1"&content="Total $340\nEnd"
SurveillanceStation.Transactions.Transaction&method="Complete"&version=2&deviceName
="POS01"&sessionId="1"