Hilton uses the following to provide a consistent experience within our services.
HTTP Methods
The Hilton API supports 5 HTTP MethodsThese are the standard request methods defined by HTTP to tell a resource the desired action.
(Synonym(s) - Verbs) for interacting with resources:
- GET: Make a GET request to retrieve data. GET requests will never cause an update or change to data.
- POST: Use a POST request to create new data records.
- PATCH: Make a PATCH request to update a resource. With PATCH requests, you only need to provide the data you want to change.
- PUT: Use a PUT request to create or update a resource. With PUT requests, you must provide all data (and not just the data changed). This is most useful for syncing data.
- DELETE: Make a DELETE request to remove data.
Services may not offer all methods across all resources.
Supported Characters
ASCII range 32-122
Parameters
Your Client App may tailor API requests by using path parameters, query string arguments, and request / response body messages. The API Catalog lists all available parameters for each request. The following sections provide more detail on the parameter options.
Path parameters
In an API URI, we include resource names and unique identifiers to help you determine how to structure your requests. Resource names do not change, but any variables must be replaced with real values. Let’s look at an example:
- Endpoint as written:
https://kapip-s.hilton.io/hospitality-partner/v2/dcshop/props/{propCode}
- As entered in the request:
https://kapip-s.hilton.io/hospitality-partner/v2/dcshop/props/MEMPH
Query string parameters
We use query string parameters for filtering, pagination, and partial responses. The query string format is a set of URL encoded name value pairs after the question mark in the URL.
- Filtering
The API Catalog shows you which resources you can filter on, and what to include in your URL query string.If you provide multiple filters, only records that match all filters will be returned.
- Pagination
Paginate your API requests to limit response results and make them easier to work with. We use offset and count in the URL query string to paginate because it provides greater control over how you view your data. Offset defaults to 0, so if you use offset=1, you’ll miss the first element in the dataset. Count defaults to 10. - Partial responses (i.e., Experience Pattern)
The API experience can be customized by using the ‘fields’ parameter during any GET request. A request specifying ‘?fields=param1,param2,...' instructs the service to return only the resource fields named param1 and param2. The fields parameter tunes the response to only the attributes needed. For example, use the following to obtain only the reservation status and property code for reservation with id equaling 12345:/dcres/12345?fields=resStatus,propCode
Request body parameters
For PATCH, PUT, and POST requests, you may need to include a request body in JSON format. The API Catalog shows you all the available request parameters for each endpoint, including required fields.
Response body parameters
Every API call response includes headers and an optional JSON-formatted body.
DELETE requests return only headers without a JSON body.