Quick start
This guide takes you from zero to your first authenticated request in about 5 minutes: getting a token, making a real GET, reading the response, paginating and understanding errors.
You need a Rently API user (with permissions to use the API) and your instance URL. In Rently each customer (tenant) lives on its own host, for example https://your-company.rently.com.ar. The host identifies the tenant, so always use your instance's host on every call.
In this guide we use https://{tenant}.rently.com.ar as an example. Replace it with your tenant's host.
1. Obtain a token
The API authenticates with an OAuth2 Bearer token. To get one, make a POST to /auth/token with your credentials using the client_credentials grant. Your API user is the client_id and your password is the client_secret.
curl -X POST https://{tenant}.rently.com.ar/auth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_USERNAME" \
-d "client_secret=YOUR_PASSWORD"
The response is a JSON with the token:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJ...",
"token_type": "bearer",
"expires_in": 86399
}
| Field | Description |
|---|---|
access_token | The token you send on every subsequent request. |
token_type | Always bearer. Defines the scheme of the Authorization header. |
expires_in | Token validity in seconds (≈ 1 day). |
The token lasts about a day (expires_in ≈ 86399 seconds). Store it and reuse it instead of requesting a new one on every request. When it expires, request another one.
The token is only valid against the same host you requested it from. If you use a token against another tenant's host, the API responds 403. Always request the token and make the calls against the same host.
2. Your first authenticated request
With the access_token, add the Authorization: Bearer {token} header to any API endpoint. Let's start with a simple GET with no parameters: listing your instance's branch offices with GET /api/branchoffices.
curl https://{tenant}.rently.com.ar/api/branchoffices \
-H "Authorization: Bearer YOUR_TOKEN"
Response (array of branch offices):
[
{
"Id": 1,
"BusinessName": "Rently LAX Airport",
"Name": "LAX Branch",
"Street": "123 Airport Road",
"Number": "Terminal 1",
"City": "Los Angeles",
"Country": "United States",
"PostalCode": "90045",
"Latitude": 33.9416,
"Longitude": -118.4085,
"Telephone": "+1-213-555-0123",
"Email": "lax@rently.com",
"IATACode": "LAX",
"IsFranchise": false,
"PublicWebSite": "https://rently.com/locations/lax"
}
]
Some endpoints accept a Language parameter to set the language of the response texts; for example, GET /api/search supports it. The value accepts the full culture name (es-AR, en-US, pt) or the two-letter ISO code (es, en). If you omit it, your instance's default language is used. Check the API reference to see which endpoints accept it.
Done: that's your first authenticated call. Every time you get a 200, you are already operating against the API.
3. A GET with pagination
Large listings come paginated. Let's look at GET /api/bookings/list, which returns bookings in blocks. It accepts these query parameters:
| Parameter | Default | Description |
|---|---|---|
offset | 0 | Pagination cursor. On the first call, 0. |
limit | 30 | Number of items per page. |
status | — | Optional filter by booking status. |
sortDirectionAsc | true | Sort direction. |
curl "https://{tenant}.rently.com.ar/api/bookings/list?offset=0&limit=30" \
-H "Authorization: Bearer YOUR_TOKEN"
The response wraps the results in a paginated structure:
{
"Offset": 0,
"Limit": 30,
"Total": 1,
"Results": [
{
"Id": 1,
"IsQuotation": false,
"Balance": 0.0,
"TotalPayed": 0.0
}
],
"NextOffset": 0
}
| Field | Description |
|---|---|
Offset / Limit | The offset and limit applied to this page. |
Total | Total number of available records. |
Results | The array of items on this page (may come back null if there are no results). |
NextOffset | The offset to send on the next call to fetch the following page. |
How to iterate the pages
To walk through all the pages, take the NextOffset from each response and pass it as offset on the next one. The iteration ends when Results returns fewer items than Limit.
# Next page: use the NextOffset returned by the previous response
curl "https://{tenant}.rently.com.ar/api/bookings/list?offset=NEXT_OFFSET&limit=30" \
-H "Authorization: Bearer YOUR_TOKEN"
4. Error handling
On an error, the API responds with an HTTP status code and, for business errors, a JSON body with the WebApiErrorResponse format:
{
"ErrorMessage": "The requested resource was not found",
"ErrorCode": 1,
"Id": "0HMV9A1B2C3D4-00000001"
}
| Field | Description |
|---|---|
ErrorMessage | Human-readable description of the error. |
ErrorCode | Numeric error code (for example, 1 = customer not found, 4 = price mismatch, 22 = booking not found). Serialized as an integer. |
Id | Correlation GUID. Useful for reporting the problem to support. |
Most common status codes:
| Status | Meaning | Body |
|---|---|---|
200 | Success. | Endpoint result. |
400 | Business or validation error. | WebApiErrorResponse with ErrorCode. |
403 | Not authenticated or no permissions. | — |
404 | Resource not found. | — |
If the token is missing, expired, or does not match the host's tenant, the API responds 403 (not 401). If you get a 403, check that the Authorization header is present, that the token has not expired and that you are using the correct tenant host.
IdWhen something fails with a 400, the Id field in the body is the correlation identifier. Include it when opening a support ticket: it lets you trace exactly what happened on the server side.
Next steps
You now have the essentials: token, authenticated request, pagination and errors. From here you can explore the rest of the API:
- Search availability and quote with
GET /api/searchandGET /api/booking/price. - Create a booking with
POST /api/booking/bookand record the payment withPOST /api/booking/pay. - Query the master catalogs:
GET /api/places,GET /api/categories,GET /api/currencies.
The full detail of each endpoint, with its parameters and schemas, is in the API reference.