You are on page 1of 14

Contents

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":""
}

Example Response: Success


{
"code": “201",
"message": "Success Message",
"errors" : []
}

Example Response: Failure


{
"code": “Error code",
"message": "Error message",
"errors" : [
{
"code": “error code",
"message": "Error Message"
}
]
}

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" : []
}

Example Response: Failure


{
"code": “Error code",
"message": "Error message",
"errors" : [
{
"code": “error code",
"message": "error message"
}
]
}

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" : []
}

Example Response: Failure


{
"code": “Error code",
"message": "Error message",
"errors" : [
{
"code": “error code",
"message": "error message"
}
]
}

Update All Client Contacts


PUT /{sourceClientId}/contacts?version=1.0
This endpoint is used to update the all client contacts
Example Request

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" : ""
}
]

Example Response: Success


{
"code": “200",
"message": "Success Message",
"errors" : []
}

Example Response: Failure


{
"code": “Error code",
"message": "Error message",
"errors" : [
{
"code": “error code",
"message": "error message"
}
]
}

Update Specific Client Contact


PUT /{sourceClientId}/contacts/{sourceContactId}?version=1.0
This endpoint is used to update the specific client contact data
Example Request

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" : ""
}

Example Response: Success


{
"code": “200",
"message": "Success Message",
"errors" : []
}
Example Response: Failure
{
"code": “Error code",
"message": "Error message",
"errors" : [
{
"code": “error code",
"message": "error message"
}
]
}

Delete All Client Contacts


DELETE /clients/{sourceClientId}/contacts?version=1.0
This endpoint is used to delete the client all contacts.
Example Request

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

Example Response: Success


{
"code": “204",
"message": "Success Message",
"errors" : []
}

Example Response: Failure


{
"code": “Error code",
"message": "Error message",
"errors" : [
{
"code": “error code",
"message": "error message"
}
]
}
Delete Specific Client Contact
DELETE /clients/{sourceClientId}/contacts/{sourceContactId}?version=1.0
This endpoint is used to delete the client specific contact.
Example Request

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

Example Response: Success


{
"code": “204",
"message": "Success Message",
"errors" : []
}

Example Response: Failure


{
"code": “Error code",
"message": "Error message",
"errors" : [
{
"code": “error code",
"message": "error message"
}
]
}
Create Hotel
POST /hotels?version=1.0
This endpoint is used to create hotel, this API take one hotel object at a time.
Example Request

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

Please note PROPCODE is the Sabre property code


Request Body:
{

"PROPCODE":"",
"INTERNALHOTELCODE":"",
"PROPNAME":"",
"PROPADD1":"",
"PROPADD2":""
}

Example Response: Success


{
"code": “201",
"message": "Success Message",
"errors" : []
}

Example Response: Failure


{
"code": “Error code",
"message": "Error message",
"errors" : [
{
"code": “error code",
"message": " Error Message"
}
]
}
Update Hotel
PUT /hotels/{INTERNALHOTELCODE }?version=1.0
This endpoint is used to update the hotel, this API take one hotel object at a time.
Example Request

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" : ""
}

Example Response: Success


{
"code": “200",
"message": "Success Message",
"errors" : []
}

Example Response: Failure


{
"code": “Error code",
"message": "Error message",
"errors" : [
{
"code": “error code",
"message": "error message"
}
]
}
Delete Hotel
PUT /hotels/{INTERNALHOTELCODE}?version=1.0
This endpoint is used to delete the hotel, this API take one hotel object at a time.
Example Request

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

Example Response: Success


{
"code": “204",
"message": "Success Message",
"errors" : []
}

Example Response: Failure


{
"code": “Error code",
"message": "Error message",
"errors" : [
{
"code": “error code",
"message": "error message"
}
]
}
Http Status Codes

200 – OK – Everything is working

201 – OK – New resource has been created

204 – OK – The resource was successfully deleted

304 – Not Modified – The client can use cached data

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”

401 – Unauthorized – The request requires a user authentication

403 – Forbidden – The server understood the request, but is refusing it or the access is not allowed.

404 – Not found – There is no resource behind the URI.

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.

503 – Service Unavailable

You might also like