BTS API Docementation
BTS API Docementation
Introduction .................................................................................................................................................. 1
Endpoints ...................................................................................................................................................... 1
Create Client ......................................................................................................................................... 1
Update Client ........................................................................................................................................ 3
Delete Client.......................................................................................................................................... 5
Update All Client Contacts .................................................................................................................... 6
Update Specific Client Contact.............................................................................................................. 7
Delete All Client Contacts ..................................................................................................................... 9
Delete Specific Client Contact ............................................................................................................. 10
Create Hotel ........................................................................................................................................ 11
Update Hotel ....................................................................................................................................... 12
Delete Hotel ........................................................................................................................................ 13
Http Status Codes ....................................................................................................................................... 14
Introduction
BTS services are secured using the Security Utility APIs. These APIs provides REST endpoints
that allow BTS and users to follow a token-based security scheme for consumption of services.
Consuming applications can use these APIs to control who (or what) can access data or call
services.
This document describes the initial version of the Security Utility APIs
Endpoints
Create Client
POST /clients?version=1.0
This endpoint is used to create clients, this API take one client object at a time.
Example Request
POST http://localhost:8080/core-web-service/clients?version=1.0
Request Headers:
Content-Type: application/json
Authorization: Bearer
T1RLAQLGvbv8bgEDtkUluJb1dBDQ1WJTfBB0OC9XwItgref4u2AKisF4AACQbcNl4UPCzFwNMMXq8VKPTNgXra2nTzlC6Ys45ku
wac6d7noUiUb1X+v7rRO5XcNiSUxyie/gPYlPsoZHOWjaQ1pUjDQHJuCZAJ0swMAm2oDiER5HRgCac57GommwHaQNqzTlr4mUgb
Y6PwQNllIeluAOtKi+42yP+4h7oaWrN/ibm5OWae7dNxDrcwZquGDM
Request Body:
{
"type":"",
"name":"",
"secondaryName":"",
"description":"",
"code":"",
"address": {
"country":"",
"address1":"",
"address2":"",
"city":"",
"state":"",
"pinCode":""
},
"phoneNumber":"",
"faxNumber":"",
"email":"",
"classification":"",
"webAddress":"",
"internalInformation": {
" managerEmail":"",
"secondaryManagerEmail":"",
"status":""
},
"contacts": [
{
"salutation":"",
"firstName":"",
"lastName":"",
"title":"",
"description":"",
"department":"",
"primary":true,
"sameAsMainAddress": true,
"address": {
"country":"",
"address1":"",
"address2":"",
"city":"",
"state":"",
"pinCode":""
},
"email":"",
"phoneNumber":"",
"mobileNumber":"",
"faxNumber":"",
"province":"",
"sourceContactId":""
}
],
"connections": [
{
"sourceClientId":"",
"relationship":"",
"sourceConnectionId":""
}
],
"sourceClientId":""
}
Update Client
PUT /clients/{sourceClientId}?version=1.0
This endpoint is used to update the client, this API take one client object at a time.
Example Request
PUT http://localhost:8080/core-web-service/clients/CL4424233?version=1.0
Request Headers:
Content-Type: application/json
Authorization: Bearer
T1RLAQLGvbv8bgEDtkUluJb1dBDQ1WJTfBB0OC9XwItgref4u2AKisF4AACQbcNl4UPCzFwNMMXq8VKPTNgXra2nTzlC6Ys45ku
wac6d7noUiUb1X+v7rRO5XcNiSUxyie/gPYlPsoZHOWjaQ1pUjDQHJuCZAJ0swMAm2oDiER5HRgCac57GommwHaQNqzTlr4mUgb
Y6PwQNllIeluAOtKi+42yP+4h7oaWrN/ibm5OWae7dNxDrcwZquGDM
Request Body:
This update API, update fields which are requested to update it. Other fields are ignored.
Fields not included in the request body will not be updated.
{
"type": "",
"name" : "",
"secondaryName" : "",
"description" : "",
"code" : "",
"address" : {
"country" : "",
"address1" : "",
"address2" : "",
"city" : "",
"state" : "",
"pinCode" : ""
},
"phoneNumber" : "",
"faxNumber" : "",
"email" : "",
"classification" : "",
"webAddress" : "",
"internalInformation" : {
"managerEmail": "",
"secondaryManagerEmail": "",
"status":""
},
"contacts": [
{
"salutation" : "",
"firstName" : "",
"lastName" : "",
"title" : "",
"description" : "",
"department" : "",
"primary" : true,
"sameAsMainAddress" : true,
"address" : {
"country" : "",
"address1" : "",
"address2" : "",
"city" : "",
"state" : "",
"pinCode" : ""
},
"email" : "",
"phoneNumber" : "",
"mobileNumber" : "",
"faxNumber" : "",
"province" : "",
"sourceContactId": ""
}
],
"connections" : [
{
"sourceClientId" : "",
"relationship" : ""
}
],
"sourceClientId" : ""
}
Example Response: Success
{
"code": “200",
"message": "Success Message",
"errors" : []
}
Delete Client
DELETE /clients/{sourceClientId}?version=1.0
This endpoint is used to delete the client, this API take one client object at a time.
Example Request
DELETE http://localhost:8080/core-web-service/clients/CL24343524?version=1.0
Request Headers:
Content-Type: application/json
Authorization: Bearer
T1RLAQLGvbv8bgEDtkUluJb1dBDQ1WJTfBB0OC9XwItgref4u2AKisF4AACQbcNl4UPCzFwNMMXq8VKPTNgXra2nTzlC6Ys45ku
wac6d7noUiUb1X+v7rRO5XcNiSUxyie/gPYlPsoZHOWjaQ1pUjDQHJuCZAJ0swMAm2oDiER5HRgCac57GommwHaQNqzTlr4mUgb
Y6PwQNllIeluAOtKi+42yP+4h7oaWrN/ibm5OWae7dNxDrcwZquGDM
Example Response: Success
{
"code": “204",
"message": "Success Message",
"errors" : []
}
UPDATE http://localhost:8080/core-web-service/clients/CL24343524/contacts?version=1.0
Request Headers:
Content-Type: application/json
Authorization: Bearer
T1RLAQLGvbv8bgEDtkUluJb1dBDQ1WJTfBB0OC9XwItgref4u2AKisF4AACQbcNl4UPCzFwNMMXq8VKPTNgXra2nTzlC6Ys45ku
wac6d7noUiUb1X+v7rRO5XcNiSUxyie/gPYlPsoZHOWjaQ1pUjDQHJuCZAJ0swMAm2oDiER5HRgCac57GommwHaQNqzTlr4mUgb
Y6PwQNllIeluAOtKi+42yP+4h7oaWrN/ibm5OWae7dNxDrcwZquGDM
Request Body:
This update API, update all contacts for the specified client
[
{
"salutation" : "",
"firstName" : "",
"lastName" : "",
"title" : "",
"description" : "",
"department" : "",
"primary" : true,
"sameAsMainAddress" : true,
"address" : {
"country" : "",
"address1" : "",
"address2" : "",
"city" : "",
"state" : "",
"pinCode" : ""
},
"email" : "",
"phoneNumber" : "",
"mobileNumber" : "",
"faxNumber" : "",
"province" : "",
"sourceContactId" : ""
}
]
UPDATE
http://localhost:8080/core-web-service/clients/CL24343524/contacts/CT43343434?version=1.0
Request Headers:
Content-Type: application/json
Authorization: Bearer
T1RLAQLGvbv8bgEDtkUluJb1dBDQ1WJTfBB0OC9XwItgref4u2AKisF4AACQbcNl4UPCzFwNMMXq8VKPTNgXra2nTzlC6Ys45ku
wac6d7noUiUb1X+v7rRO5XcNiSUxyie/gPYlPsoZHOWjaQ1pUjDQHJuCZAJ0swMAm2oDiER5HRgCac57GommwHaQNqzTlr4mUgb
Y6PwQNllIeluAOtKi+42yP+4h7oaWrN/ibm5OWae7dNxDrcwZquGDM
Request Body:
This update API, update all contacts for the specified client
{
"salutation" : "",
"firstName" : "",
"lastName" : "",
"title" : "",
"description" : "",
"department" : "",
"primary" : true,
"sameAsMainAddress" : true,
"address" : {
"country" : "",
"address1" : "",
"address2" : "",
"city" : "",
"state" : "",
"pinCode" : ""
},
"email" : "",
"phoneNumber" : "",
"mobileNumber" : "",
"faxNumber" : "",
"province" : "",
"sourceContactId" : ""
}
DELETE http://localhost:8080/core-web-service/clients/CL24343524/contacts?version=1.0
Request Headers:
Content-Type: application/json
Authorization: Bearer
T1RLAQLGvbv8bgEDtkUluJb1dBDQ1WJTfBB0OC9XwItgref4u2AKisF4AACQbcNl4UPCzFwNMMXq8VKPTNgXra2nTzlC6Ys45ku
wac6d7noUiUb1X+v7rRO5XcNiSUxyie/gPYlPsoZHOWjaQ1pUjDQHJuCZAJ0swMAm2oDiER5HRgCac57GommwHaQNqzTlr4mUgb
Y6PwQNllIeluAOtKi+42yP+4h7oaWrN/ibm5OWae7dNxDrcwZquGDM
DELETE
http://localhost:8080/core-web-service/clients/CL24343524/contacts/CT4343454?version=1.0
Request Headers:
Content-Type: application/json
Authorization: Bearer
T1RLAQLGvbv8bgEDtkUluJb1dBDQ1WJTfBB0OC9XwItgref4u2AKisF4AACQbcNl4UPCzFwNMMXq8VKPTNgXra2nTzlC6Ys45ku
wac6d7noUiUb1X+v7rRO5XcNiSUxyie/gPYlPsoZHOWjaQ1pUjDQHJuCZAJ0swMAm2oDiER5HRgCac57GommwHaQNqzTlr4mUgb
Y6PwQNllIeluAOtKi+42yP+4h7oaWrN/ibm5OWae7dNxDrcwZquGDM
POST http://localhost:8080/property-web-service/hotels?version=1.0
Request Headers:
Content-Type: application/json
Authorization: Bearer
T1RLAQLGvbv8bgEDtkUluJb1dBDQ1WJTfBB0OC9XwItgref4u2AKisF4AACQbcNl4UPCzFwNMMXq8VKPTNgXra2nTzlC6Ys45ku
wac6d7noUiUb1X+v7rRO5XcNiSUxyie/gPYlPsoZHOWjaQ1pUjDQHJuCZAJ0swMAm2oDiER5HRgCac57GommwHaQNqzTlr4mUgb
Y6PwQNllIeluAOtKi+42yP+4h7oaWrN/ibm5OWae7dNxDrcwZquGDM
"PROPCODE":"",
"INTERNALHOTELCODE":"",
"PROPNAME":"",
"PROPADD1":"",
"PROPADD2":""
}
PUT http://localhost:8080/property-web-service/hotels/H9892432?version=1.0
Request Headers:
Content-Type: application/json
Authorization: Bearer
T1RLAQLGvbv8bgEDtkUluJb1dBDQ1WJTfBB0OC9XwItgref4u2AKisF4AACQbcNl4UPCzFwNMMXq8VKPTNgXra2nTzlC6Ys45ku
wac6d7noUiUb1X+v7rRO5XcNiSUxyie/gPYlPsoZHOWjaQ1pUjDQHJuCZAJ0swMAm2oDiER5HRgCac57GommwHaQNqzTlr4mUgb
Y6PwQNllIeluAOtKi+42yP+4h7oaWrN/ibm5OWae7dNxDrcwZquGDM
Request Body:
This update API, update fields which are requested to update it. Other fields are ignored.
Ex: here user not passing PROPNAME data, PROPNAME data will not be updated.
{
"PROPCODE" : "",
"INTERNALHOTELCODE" : "",
"PROPADD1" : "",
"PROPADD2" : ""
}
DELETE http://localhost:8080/property-web-service/hotels/H5375445?version=1.0
Request Headers:
Content-Type: application/json
Authorization: Bearer
T1RLAQLGvbv8bgEDtkUluJb1dBDQ1WJTfBB0OC9XwItgref4u2AKisF4AACQbcNl4UPCzFwNMMXq8VKPTNgXra2nTzlC6Ys45ku
wac6d7noUiUb1X+v7rRO5XcNiSUxyie/gPYlPsoZHOWjaQ1pUjDQHJuCZAJ0swMAm2oDiER5HRgCac57GommwHaQNqzTlr4mUgb
Y6PwQNllIeluAOtKi+42yP+4h7oaWrN/ibm5OWae7dNxDrcwZquGDM
400 – Bad Request – The request was invalid or cannot be served. The exact error should be explained in
the error payload. E.g. „The JSON is not valid”
403 – Forbidden – The server understood the request, but is refusing it or the access is not allowed.
500 – Internal Server Error – API developers should avoid this error. If an error occurs in the global catch
blog, the stack trace should be logged and not returned as response.