You can save trip categories for reuse in statements.
EXAMPLE OBJECT
{
"trip_category": {
"id": 12,
"name": "Travelling",
"rate": "10.0",
"formatted_rate": "10.00",
"created_at": "2014-07-21T11:04:58Z"
}
}
Attributes
| Attribute | Description |
|---|---|
| id | integer ID |
| name | string Trip name |
| rate | string Trip rate |
DEFINITION
POST https://[subdomain].hiveage.com/api/categories/trips
EXAMPLE JSON REQUEST
$ curl https://[subdomain].hiveage.com/api/categories/trips\
-H "Accept: application/json" \
-u 6ZQHxidcLHnkcsnDbfM5: \
-d trip_category[name]="Travelling" \
-d trip_category[rate]="10.00" \
EXAMPLE RESPONSE
{
"trip_category": {
"id": 12,
"name": "Travelling",
"rate": "10.0",
"formatted_rate": "10.00",
"created_at": "2014-07-21T11:04:58Z"
}
}
Attributes
| Parameter | Description |
|---|---|
| name | required |
| rate | string Trip rate |
Return
Returns the trip object.
Retrieve a trip object with a specified ID.
DEFINITION
GET https://[subdomain].hiveage.com/api/categories/trips/[id]
EXAMPLE JSON REQUEST
$ curl https://[subdomain].hiveage.com/api/categories/trips/[id]\
-H "Accept: application/json" \
-u 6ZQHxidcLHnkcsnDbfM5: \
EXAMPLE RESPONSE
{
"trip_category": {
"id": 12,
"name": "Travelling",
"rate": "10.0",
"formatted_rate": "10.00",
"created_at": "2014-07-21T11:04:58Z"
}
}
Arguments
| Parameter | Description |
|---|---|
| id | required The id of trip category object. |
Returns
Returns a trip JSON object if a valid trip category ID was provided. Returns an error otherwise.
Update a trip category.
DEFINITION
PUT https://[subdomain].hiveage.com/api/categories/trips/[id]
EXAMPLE JSON REQUEST
$ curl https://[subdomain].hiveage.com/api/categories/trips/[id]\
-H "Accept: application/json" \
-u 6ZQHxidcLHnkcsnDbfM5: \
-d trip_category[name]="Development" \
-d trip_category[rate]="20.0" \
EXAMPLE RESPONSE
{
"trip_category": {
"id": 12,
"name": "Travelling",
"rate": "20.0",
"formatted_rate": "10.00",
"created_at": "2014-07-21T11:04:58Z"
}
}
Arguments
| Arguments | Description |
|---|---|
| name | required |
| rate | string Trip rate |
Returns
Returns a updated trip JSON object if a valid trip ID was specified. Returns an error otherwise.
Deleting a trip object permanently.
DEFINITION
DELETE https://[subdomain].hiveage.com/api/categories/trips/[id]
EXAMPLE REQUEST
$ curl https://[subdomain].hiveage.com/api/categories/trips/[id]\
-H "Accept: application/json" \
-u 6ZQHxidcLHnkcsnDbfM5: \
SAMPLE JSON RESPONSE
{
"trip_category": {
"deleted": true,
"id": "13"
}
}
Arguments
| Parameter | Description |
|---|---|
| id | required The ID of the trip to be deleted. |
Returns an object with a deleted parameter on success.
Returns a list of trips. The trips are returned sorted alphabetically.
DEFINITION
GET https://[subdomain].hiveage.com/api/categories/trips
EXAMPLE REQUEST
$ curl https://[subdomain].hiveage.com/api/categories/trips\
-H "Accept: application/json" \
-u 6ZQHxidcLHnkcsnDbfM5: \
SAMPLE JSON RESPONSE
{
"trip_categories": [{
"id": 13,
"name": "Travelling",
"rate": "20.0",
"formatted_rate": "10.00",
"created_at": "2014-07-21T11:04:58Z"
}
{...},
{...}]
}
The results will be paginated. You can use the following optional parameters to traverse the results.
Arguments
| Parameter | Description |
|---|---|
| per_page | optional Number of results per page (default: 20). Available per page: 20, 60 and 100. |
| page | optional Page in the results set |
| order | optional The list is ordered by name, and can be ordered by desc or asc. The defaul value is asc. |