Tags
This section describes the API of the tags resource.
Parameters
id: | integer |
name: | string |
Example of Tag
List tags
Retrieve all tags from a specific organization.
Parameters
page: | integer |
per_page: | integer limit to 100 |
Definition
GET https://app.rexpense.com/api/v1/organizations/:id/tags
Example Request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/organizations/1/tags \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Response Example
Show a tag
This request shows the tag complete information.
To visualize a tag you have to be an Organization's Administrator or Manager.
Parameters
id: | integer required |
Definition
GET https://app.rexpense.com/api/v1/organizations/:organization_id/tags/:id
Example Request
$ curl -u $YOUR_API_TOKEN:X -X POST https://app.rexpense.com/api/v1/organizations/1/tags/1 \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Response Example Success
HTTP 200 OK
Response Example Failure
HTTP 404 Record Not Found
Create a tag
This request creates a new tag.
To create a tag you have to be an Organization's Administrator or Manager.
It is possible to restrict the tag to a group of users in the organization through the restricted_user_ids
parameter. It means only users in restricted_user_ids
will be able to use the tag.
Parameters
name: | string |
restricted_user_ids: | array of user IDs optional |
Definition
POST https://app.rexpense.com/api/v1/organization/:organization_id/tags
Example Request
$ curl -u $YOUR_API_TOKEN:X -X POST https://app.rexpense.com/api/v1/organization/1/tags \ -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -d '{"name":"Restaurant","restricted_user_ids":[1900,1945]}'
Response Example Success
HTTP 201 CREATED
Response Example Failure
HTTP 422 Unprocessable Entity
Update a tag
This request updates a new tag.
To update a tag you have to be an Organization's Administrator or Manager.
Parameters
name: | string |
restricted_user_ids: | array of user IDs optional |
Definition
PUT https://app.rexpense.com/api/v1/organizations/:organization_id/tags
Example Request
$ curl -u $YOUR_API_TOKEN:X -X PATCH https://app.rexpense.com/api/v1/organizations/1/tags/1 \ -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -d '{"name":"Restaurant"}'
Response Example Success
HTTP 200 OK
Response Example Failure
HTTP 422 Unprocessable Entity
Destroy a tag
To destroy a tag you have to be an Organization's Administrator or Manager.
Definition
DELETE https://app.rexpense.com/api/v1/organizations/:organization_id/tags/:id
Example Request
$ curl -u $YOUR_API_TOKEN:X -X DELETE https://app.rexpense.com/api/v1/organizations/1/tags/1 \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Response Example
HTTP 204 NO CONTENT