Introduction
Info |
---|
This introduction is written based on experience drawn from a lot of custom integrations. It is aimed at consultants implementing an integration for a BRP-customer. An API-integration with BRP is a very complex task, not in a technical sense but the domain knowledge required for a successful end result is substantial. As a consultant you will have to spend a lot of time in cooperation with your client's BRP-users to gain a full understanding of the system and how it is used. Every integration project must have these three roles defined before even starting: BRP will debit the hours spent on the project. There is a monthly fee for access to the API. |
...
Hiddenfragment macro | ||
---|---|---|
| ||
Ligger webservern bakom en reverse proxy så krävs det att reverse proxyn sätter en http-header med vilken ip-adress som anropet kommer ifrån. Inställningen 'ipHeaderReverseProxy' måste då sättas för att servern ska veta vilken header som den ska titta på. Vanligast är att den kallas: "X-Forwarded-For". Om headern förväntas innehålla någonting mer komplicerat än bara en vanlig IP-address så kan det behövas en uppdatering, eftersom vårat stöd för rfc7239 inte är speciellt robust. Glöm inte att köra about.gsp för att gogen ska läsa om inställningarna. |
Support tickets
Be as specific as you can possibly be, for example:
- Present yourself properly, who are you working for and who is our joint customer.
- Show us the full request including URL and API-key.
- Tell us what your result was and what result you were expecting.
- Let us know if you got an error message and what it said.
- Let us know how severe your problem is for your production.
Limited liability
This document is a work in progress and must be interpreted as such. Corrections and modifications can and will occur and BRP Systems shall not be held responsible for subsequent modifications required on part of end users.
Scope of purpose
The purpose of this API is not to offer a means to replacing the BRP java client but more to work as a complement for web and mobile based services. While the API is limited in its features in comparison to the main client, BRP is continuously developing and improving it. Suggestions are welcome.
Authentication
Basic HTTP-authentication is used. The username can be an e-mail adress, card number or customer number.
Error management
Any and all error messages will be displayed in English.
...
Code Block | ||
---|---|---|
| ||
<errors> <error> <code>1001</code> <message>Invalid parameter, firstname</message> <debuginfo>field=firstname</debuginfo> </error> </errors> |
Format
Data type | Format | Example | Comments |
---|---|---|---|
Date | yyyy-MM-DD | 2012-12-24 | GMT+1 (Stockholm) including adjustments required for summer and winter time |
Time | HH:mm | 14:54 | GMT+1 (Stockholm) including adjustments required for summer and winter time |
Timestamp | nnnnnnnnnnnnn | 1298023236 | Unix Epoch, Number of seconds since 1/1 1970, 00:00:00 GMT |
Boolean | true/false | true | |
ID-list | n,n,n.... | 1,2,45 | List containing object id |
String | Spinningsal | Text string UTF-8 in desired length. Characters are escaped in accordance with either XML or JSON standards. | |
Number | nnnnnnnnn | 124234 | Integers are always specified without thousands separators or 10 powers |
Decimal | nnnn.nnn | 34.45 | There are no limits for the number of decimals that may be used. No thousands separators or 10 powers. If the number of decimals is 0 no decimal divider will be sent. |
ID | nnnn | 43 | Integer that is an object ID |
Product type | groupActivity/ subscription/ package/ article/ service/ event/ stockProduct/ valueCard/ entry | groupActivity | Text strings that represent product groups |
Sex | male/female | female | Text strings denoting sex |
Valid e-mail address | |||
Personal ID number | 850101-123X | Valid Swedish, Norwegian or Finnish personal ID number, depending on the facility. For persons connected to a Swedish facility a Swedish personal ID number must be used. | |
Telephone number | 013-342 00 20 | Valid telephone number |
Miscellaneous
When currency is used it is specified in Swedish öre or Euro cents. For example: SEK 34,99 is formatted as 3499.
Encoding
When REST-objects are created or modified and HTML encoding is used the sent text must NOT be sent in the request string, it must be sent in the body. This is to avoid an improper display of characters when a LATIN-1 interpretation of a UTF-8 string will result in Göteborg instead of Göteborg.
Requests
Parameters
Parameter names must be formatted in lowercase.
...
Code Block |
---|
https://api.brpsystems.se/brpgog/api/ver2/baz |
API key
An API key is required for all requests.
...
- Level 1: Required for GET requests where contents are only displayed, not modified. This is commonly used to display items such as today's schedule where no interaction is required.
- Level 2: Required for PUT, DELETE and POST requests. This is used when objects need to be created, modified or even deleted. Amoung other uses this is commonly used when a user's login credentials are stored in a mobile phone.
- Level 3: This level used for system to system requests where the user's credentials are not known. The IP number of the requesting device must be pre-registered in order for this to work.
Response
Response tags that represent valid objects always contain the objects unique ID, always an integer.
...
Hiddenfragment macro | ||
---|---|---|
| ||
Filter responseFrom version x it is possible to control what fields are sent back from the API. This is done with the parameters response.include / response.exclude. Only one of these can be specified and if response.include is specified response.exclude is ignored. The value of the parameter should be the path for the fields to be included/excluded. The paths corresponds to the XML answer so if you are using JSON it makes it easier if you check the return value in xml-format to see how you should format your include/exclude-parameter. Example: Asking for products from products.json we just want id and name and nothing else. Do a call to products.xml to see the structure: The include parameters to get only id and name for this call would look like this: .../products.json?response.include=products.product.id&response.include=products.product.name The response JSON will then look like this: |
Definitions
Word | Definition | Comments |
---|---|---|
activitybooking | Class booking | Class booking and waiting list |
purchase | Purchase | Purchase of services, events, goods, subscriptions, value cards and deals |
person | User/booker | |
resource | Resource | Rooms, instructors, staff, equipment etc. |
activity | Group activity/class | |
event | Event | Events such as speaches, courses |
order | Order | Completed order, either paid or confirmed |
bokning | Booking | Based on type of product: service, goods, subscription, valuecard and deal |
receipt | Receipt | |
item | Order row or receipt row | |
timeslotsuggestions | Suggested time for service booking |
...