s
http://deluxe.countbox.us/api/xml - API access address
http://deluxe.countbox.us/api/json - to receive data in JSON format
Authentication
API authentication requires POST request with specified parameter access_token with a token value obtained via token passing method (token expires at defined time)
API requests
Token
Receiving token: [GET]
http://deluxe.countbox.us/api/{format}/token/get/{auth}
| {auth} | value is email:password in base64 i.e. base64("email:password") http://deluxe.countbox.us/api/json/token/get/Z3JR1c0BnbWFpbC5jb206cmVzdGVy |
Response
key - token, should be obtained via РОST request 'access_token=key'
XML response example:
<Token xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<key>sample string 1</key>
</Token>
JSON response example:
{
"key": "sample string 1"
}
Locations
Locations list receiving: [POST]
http://deluxe.countbox.us/api/{format}/point/all/
Request
POST data
access_token – received token (mandatory)
Example
access_token=34424109BC2D728FA33C2606B5DECA2C71BF146C7848922D88D3B25DC32963AE6F814C3E04C8CC
Response
An array containing, id - location identifier name - name of the location IdTt - location code (ERP) address – location address
XML response example:
<ArrayOfPoint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Point>
<id>1</id>
<name>sample name 1</name>
<IdTt>sample code 1</IdTt>
<address>sample address 1</address>
</Point>
<Point>
<id>2</id>
<name>sample name 2</name>
<IdTt>sample code 2</IdTt>
<address>sample address 2</address>
</Point>
<Point>
<id>3</id>
<name>sample name 3</name>
<IdTt>sample code 3</IdTt>
<address>sample address 3</address>
</Point>
</ArrayOfPoint>
JSON response example:
[
{
"id": 1,
"name": "sample name 1",
"IdTt": "sample code 1",
"address": "sample address 1"
},
{
"id": 2,
"name": "sample name 2",
"IdTt": "sample code 2",
"address": "sample address 2"
},
{
"id": 3,
"name": "sample name 3",
"IdTt": "sample code 3",
"address": "sample address 3"
}
]
Finances
Financial data adding: [POST]
http://deluxe.countbox.us/api/{format}/point/addfinance/
Request
POST data
access_token - token received (mandatory) id - location identifier (mandatory) profit - daily earnings (mandatory) checks - receipts quantity (mandatory) date - actual date (mandatory)
Example
access_token=34424109BC2D728FA33C2606B5DECA2C71BF146C7848922D88D3B25DC32963AE6F814C3E04C8CC &id=1 &profit=123456.85 &checks=100 &date=2014-09-26T09:42:48.7966108
Response
result – result of adding (1 - ok, 0 - error)
XML response example:
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<result>1</result>
</Response>
JSON response example:
{
"result": 1
}
Financial data getting: [POST]
http://deluxe.countbox.us/api/{format}/point/getfinance/
Response
POST data
access_token - token received (mandatory)
id - location identifier (mandatory)
id may be send as single identifier, and also as a list with
separator ','
for example id=1 or id=1,2,3,4
to require all the locations simultaneously use 'all'
for example id=all
datebegin - starting date (mandatory)
dateend - final date (mandatory)
groupType - type of data grouping interval (mandatory)
groupType = 1 - day
groupType = 2 - month
groupType = 3 - year
isAllTime - no location operation schedule (not mandatory)
- with location working schedule (by default)
Example
access_token=34424109BC2D728FA33C2606B5DECA2C71BF146C7848922D88D3B25DC32963AE6F814C3E04C8CC &id=1 &datebegin=2014-09-21T00:00:00 &dateend=2014-09-23T23:00:00 &groupType=1 &isAllTime=true
Response
An array containing, id - location identifier profit - earnings summary checks - receipts quantity conversion - conversion datebegin - starting date (according to the preferred type of data grouping interval) dateend - final date (according to the preferred type of data grouping interval)
XML response example:
<ArrayOfFinance xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Finance>
<id>1</id>
<profit>1254.0</profit>
<checks>3</checks>
<conversion>4.1</conversion>
<datebegin>2014-09-21T00:00:00+04:00</date>
<dateend>2014-09-21T23:59:59+04:00</date>
</Finance>
<Finance>
<id>1</id>
<profit>12345.0</profit>
<checks>3</checks>
<conversion>4.1</conversion>
<datebegin>2014-09-22T00:00:00+04:00</date>
<dateend>2014-09-22T23:59:59+04:00</date>
</Finance>
<Finance>
<id>1</id>
<profit>12345.0</profit>
<checks>3</checks>
<conversion>4.1</conversion>
<datebegin>2014-09-23T00:00:00+04:00</date>
<dateend>2014-09-23T23:59:59+04:00</date>
</Finance>
</ArrayOfFinance>
JSON response example:
[
{
"id": 1,
"profit": 1254.0,
"checks": 3,
"conversion": 4.1,
"datebegin": "2014-09-21T00:00:00",
"dateend": "2014-09-21T23:59:59",
},
{
"id": 1,
"profit": 12345.0,
"checks": 3,
"conversion": 4.1,
"datebegin": "2014-09-22T00:00:00",
"dateend": "2014-09-22T23:59:59",
},
{
"id": 1,
"profit": 12345.0,
"checks": 3,
"conversion": 4.1,
"datebegin": "2014-09-23T00:00:00",
"dateend": "2014-09-23T23:59:59",
}
]
Getting financial data with the visitors data: [POST]
http://deluxe.countbox.us/api/{format}/point/getfullfinance/
Request
POST data
access_token - received token (mandatory)
id - location identifier (mandatory)
id may be send as single identifier, and also as a list with
separator ','
for example id=1 or id=1,2,3,4
to require all the locations simultaneously use 'all'
for example id=all
datebegin - starting date (mandatory)
dateend - final date (mandatory)
groupType - type of data grouping interval (mandatory)
groupType = 1 - day
groupType = 2 - month
groupType = 3 - year
isAllTime - no location operation schedule (not mandatory)
- with location working schedule (by default)
Example
access_token=34424109BC2D728FA33C2606B5DECA2C71BF146C7848922D88D3B25DC32963AE6F814C3E04C8CC &id=1 &datebegin=2014-09-21T00:00:00 &dateend=2014-09-23T23:00:00 &groupType=1 &isAllTime=true
Response
An array containing, id - location identifier profit - earnings summary checks - receipts quantity conversion - conversion datebegin - starting date (according to the preferred type of data grouping interval) dateend - final date (according to the preferred type of data grouping interval) in - in traffic for the preferred type of data grouping interval out - out traffic for the preferred type of data grouping interval
XML response example:
<ArrayOfFinance xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Finance>
<id>1</id>
<profit>1254.0</profit>
<checks>3</checks>
<conversion>4.1</conversion>
<datebegin>2014-09-21T00:00:00+04:00</date>
<dateend>2014-09-21T23:59:59+04:00</date>
<in>500</in>
<out>500</out>
</Finance>
<Finance>
<id>1</id>
<profit>12345.0</profit>
<checks>3</checks>
<conversion>4.1</conversion>
<datebegin>2014-09-22T00:00:00+04:00</date>
<dateend>2014-09-22T23:59:59+04:00</date>
<in>500</in>
<out>500</out>
</Finance>
<Finance>
<id>1</id>
<profit>12345.0</profit>
<checks>3</checks>
<conversion>4.1</conversion>
<datebegin>2014-09-23T00:00:00+04:00</date>
<dateend>2014-09-23T23:59:59+04:00</date>
<in>500</in>
<out>500</out>
</Finance>
</ArrayOfFinance>
JSON response example:
[
{
"id": 1,
"profit": 1254.0,
"checks": 3,
"conversion": 4.1,
"datebegin": "2014-09-21T00:00:00",
"dateend": "2014-09-21T23:59:59",
"in": 500,
"out": 500
},
{
"id": 1,
"profit": 12345.0,
"checks": 3,
"conversion": 4.1,
"datebegin": "2014-09-22T00:00:00",
"dateend": "2014-09-22T23:59:59",
"in": 500,
"out": 500
},
{
"id": 1,
"profit": 12345.0,
"checks": 3,
"conversion": 4.1,
"datebegin": "2014-09-23T00:00:00",
"dateend": "2014-09-23T23:59:59",
"in": 500,
"out": 500
}
]
Visitors
Getting visitors’ quantity in the location at the defined period of time: [POST]
http://deluxe.countbox.us/api/{format}/point/getvisitors/
Request
POST data
access_token - received token (mandatory)
id - location identifier (mandatory)
id may be send as single identifier, and also as a list with
separator ','
for example id=1 or id=1,2,3,4
to require all the locations simultaneously use 'all'
for example id=all
datetime - requested date and time (mandatory)
Example
access_token=34424109BC2D728FA33C2606B5DECA2C71BF146C7848922D88D3B25DC32963AE6F814C3E04C8CC &id=1 &datetime=2014-09-21T09:43:00
Response
id - location identifier datetime - date of the recorded attendance visitor - visitors quantity at the requested date and time (calculated value)
XML response example:
<ArrayOfVisitor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Visitor>
<id>1</id>
<visitor>20</visitor>
<datetime>2014-09-21T09:30:00+04:00</datetime>
</Visitor>
</ArrayOfVisitor>
JSON response example:
[
{
"id": 1,
"visitor": 2,
"datetime": "2014-09-21T09:30:00"
}
]
Getting visitors’ attendance for the defined time period: [POST]
http://deluxe.countbox.us/api/{format}/point/getattendance/
Request
POST data
access_token - received token (mandatory)
id - location identifier (mandatory)
id may be send as single identifier, and also as a list with
separator ','
for example id=1 or id=1,2,3,4
to require all the locations simultaneously use 'all'
for example id=all
datebegin - date and time request starts from (mandatory)
dateend - date and time request ends before (mandatory)
groupType - type of data grouping interval (mandatory)
groupType = 1 – 15 minutes
groupType = 2 – 1 hour
groupType = 3 – 1 day
isAllTime - no location operation schedule (not mandatory)
- with location working schedule (by default)
Example
access_token=34424109BC2D728FA33C2606B5DECA2C71BF146C7848922D88D3B25DC32963AE6F814C3E04C8CC &id=1 &datebegin=2014-09-21T09:00:00 &dateend=2014-09-21T23:00:00 &groupType=1 &isAllTime=true
Response
id - location identifier in - in traffic out - out traffic datebegin - date and time interval grouping starts from dateend - date and time interval grouping ends before
XML response example:
<ArrayOfAttendance xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Attendance>
<id>1</id>
<in>2</in>
<out>3</out>
<datebegin>2014-09-21T09:00:00+04:00</datebegin>
<dateend>2014-09-21T09:15:00+04:00</dateend>
</Attendance>
<Attendance>
<id>1</id>
<in>2</in>
<out>3</out>
<datebegin>2014-09-21T09:15:00+04:00</datebegin>
<dateend>2014-09-21T09:30:00+04:00</dateend>
</Attendance>
<Attendance>
<id>1</id>
<in>2</in>
<out>3</out>
<datebegin>2014-09-21T09:30:00+04:00</datebegin>
<dateend>2014-09-21T09:45:00+04:00</dateend>
</Attendance>
...
</ArrayOfAttendance>
JSON response example:
[
{
"id": 1,
"in": 2,
"out": 3,
"datebegin": "2014-09-21T09:00:00",
"dateend": "2014-09-21T09:15:00"
},
{
"id": 1,
"in": 2,
"out": 3,
"datebegin": "2014-09-21T09:15:00",
"dateend": "2014-09-21T09:30:00"
},
{
"id": 1,
"in": 2,
"out": 3,
"datebegin": "2014-09-21T09:30:00",
"dateend": "2014-09-21T09:45:00"
}
...
]
Getting SIM-report data for the defined period of time: [POST]
http://deluxe.countbox.us/api/{format}/point/getsimdata/
Request
POST data
access_token - received token (mandatory)
id - location identifier (mandatory)
id may be send as single identifier, and also as a list with
separator ','
for example id=1 or id=1,2,3,4
to require all the locations simultaneously use 'all'
for example id=all
datebegin - date of the first week(month) (mandatory)
dateend - date of the second week (month) (mandatory)
isByWeek - interval type. week or month(by default) (not mandatory)
Example
access_token=34424109BC2D728FA33C2606B5DECA2C71BF146C7848922D88D3B25DC32963AE6F814C3E04C8CC &id=1 &datebegin=2014-08-27 &dateend=2014-09-04 &isByWeek=true
Response
id - location identifier visitors - visitors quantity checks - receipts quantity profits - earnings summary date - date and time interval grouping started from
XML response example:
<ArrayOfPoints xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Point>
<id>1</id>
<First>
<datebegin>2014-08-25</datebegin>
<dateend>2014-08-31</dateend>
<visitors>2</visitors>
<checks>3</checks>
<profits>11.0000</profits>
</First>
<Second>
<datebegin>2014-09-01</datebegin>
<dateend>2014-09-07</dateend>
<visitors>2</visitors>
<checks>3</checks>
<profits>11.0000</profits>
</Second>
</Point>
<Point>
<id>2</id>
<First>
<datebegin>2014-08-25</datebegin>
<dateend>2014-08-31</dateend>
<visitors>12</visitors>
<checks>30</checks>
<profits>181.0000</profits>
</First>
<Second>
<datebegin>2014-09-01</datebegin>
<dateend>2014-09-07</dateend>
<visitors>12</visitors>
<checks>30</checks>
<profits>181.0000</profits>
</Second>
</Point>
</ArrayOfPoints>
JSON response example:
[
{
"id": 1,
"first":
{
"datebegin": "2014-08-25",
"dateend": "2014-08-31",
"visitors": 2,
"checks": 3,
"profits": 11.000
},
"second":
{
"datebegin": "2014-09-01",
"dateend": "2014-09-07",
"visitors": 2,
"checks": 3,
"profits": 11.000
}
}
{
"id": 2,
"first":
{
"datebegin": "2014-08-25",
"dateend": "2014-08-31",
"visitors": 12,
"checks": 30,
"profits": 181.000
} ,
"second":
{
"datebegin": "2014-09-01",
"dateend": "2014-09-07",
"visitors": 12,
"checks": 30,
"profits": 181.000
}
}
]
Profile
Getting users data: [GET]
http://deluxe.countbox.us/api/{format}/profile/get/
Request
GET data
access_token - received token (mandatory)
Example
access_token=34424109BC2D728FA33C2606B5DECA2C71BF146C7848922D88D3B25DC32963AE6F814C3E04C8CC
XML response example:
<User xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<username>user</username>
<email>user@user.ru</email>
<firstname>John</firstname>
<lastname>Smith</lastname>
</User>
JSON response example:
[
{
"username": "user"
"email": "user@user.ru",
"firstname": "John",
"lastname": "Smith"
}
]
User’s password recovery Request: [POST]
http://deluxe.countbox.us/api/{format}/profile/recoverpassword/
Request
POST data
Email - user’s email (mandatory)
Example
Email=user@user.ru
XML response example:
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>status</string>
<string>/recoverpassword/be0dbce6-90d7-4cad-9b57-02b50a7097bc</string>
</ArrayOfString>
JSON response example:
["status","/recoverpassword/be0dbce6-90d7-4cad-9b57-02b50a7097bc"]
Error
Errors format description
Response
error - error Message - response with an error ErrorCode - error code (not mandatory)
Errors code
403 – access forbidden 504 – token is expired
XML response example:
<Error>
<error>1</error>
<Message>error auth data</Message>
<ErrorCode>200</ErrorCode>
</Error>
JSON response example:
{
"error": 1
"Message":"test error",
"ErrorCode":200
}
If response contains more than one error
XML response example:
<Errors>
<Error>
<Message>error data</Message>
<ErrorCode>100</ErrorCode>
</Error>
...
<Error>
<Message>error data ... </Message>
<ErrorCode>100</ErrorCode>
</Error>
</Errors>
JSON response example:
Errors[
{
"error": 1
"Message":"test error",
"ErrorCode":200
},
...
]
Comments
0 comments
Please sign in to leave a comment.