Comments
An Expense or an Advancement or a Reimbursement can have several comments, which belongs to an user and has a content.
Parameters
content: | string |
user: | user object representation |
Example Comment
List all comments
Retrieve the list of comments of an Expense or an Advancement or a Reimbursement. It will return a JSON containing the name of the resource with an array of the objects requested using the comment representation and informations like the total of objects, current page and total pages.
If the content
of the comments have emojis, they will be rendered as text code by default (for example, :smile:
). However, if you'd like to get the unicode of the emojis instead, you should supply a emoji_in_unicode
boolean param.
Parameters
page: | integer |
per_page: | integer limit to 100 |
emoji_in_unicode: | boolean |
Definition (comment of an Expense)
GET https://app.rexpense.com/api/v1/expenses/:expense_id/comments
Example Request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/expenses/1/comments \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Example Response
Definition (comment of an Advancement)
GET https://app.rexpense.com/api/v1/advancements/:advancement_id/comments
Example Request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/advancements/1/comments \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Example Response
Definition (comment of a Reimbursement)
GET https://app.rexpense.com/api/v1/reimbursements/:reimbursement_id/comments
Example Request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/reimbursements/1/comments \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Example Response
Show a comment
Retrieve a specific comment of an Expense, an Advancement or a Reimbursement. Returns a detailed representation of the comment.
If the content
of the comments have emojis, they will be rendered as text code by default (for example, :smile:
). However, if you'd like to get the unicode of the emojis instead, you should supply a emoji_in_unicode
boolean param.
Parameter
emoji_in_unicode: | boolean |
If the Expense or Advancement or Reimbursement is deleted, the request will return a 410 Gone
HTTP status with an empty body.
Definition (comment of an Expense)
GET https://app.rexpense.com/api/v1/expenses/:expense_id/comments/:id
Example Request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/expenses/1/comments/1 \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Example Response
Definition (comment of an Advancement)
GET https://app.rexpense.com/api/v1/advancements/:advancement_id/comments/:id
Example Request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/advancements/1/comments/1 \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Example Response
Definition (comment of a Reimbursement)
GET https://app.rexpense.com/api/v1/reimbursements/:reimbursement_id/comments/:id
Example Request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/reimbursements/1/comments/1 \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Example Response
Create a comment
This request creates a new comment.
Parameter
content: | string |
Content
field has support for Emojis. To know more about it, please visit
Emoji section.
You can provide emojis in two forms: as text code (:+1:
, for example) or unicode.
Expired organization
If the organization is expired, it will return an 402 error.
Definition (comment of an Expense)
POST https://app.rexpense.com/api/v1/expenses/:expense_id/comments
Example Request
$ curl -u $YOUR_API_TOKEN:X -X POST https://app.rexpense.com/api/v1/expenses/1/comments \ -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -d '{"content": "My second comment"}'
Response Example Success
HTTP 201 CREATED
Response Example Failure
HTTP 422 Unprocessable Entity
Definition (comment of an Advancement)
POST https://app.rexpense.com/api/v1/advancements/:advancement_id/comments
Example Request
$ curl -u $YOUR_API_TOKEN:X -X POST https://app.rexpense.com/api/v1/advancements/1/comments \ -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -d '{"content": "My second comment"}'
Response Example Success
HTTP 201 CREATED
Definition (comment of a Reimbursement)
POST https://app.rexpense.com/api/v1/reimbursements/:reimbursement_id/comments
Example Request
$ curl -u $YOUR_API_TOKEN:X -X POST https://app.rexpense.com/api/v1/reimbursements/1/comments \ -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -d '{"content": "My second comment"}'
Response Example Success
HTTP 201 CREATED
Response Example Failure
HTTP 422 Unprocessable Entity
Example Response Failure when organization is expired
HTTP 402 Payment Required
Update a comment
Updates a comment of an Expense or an Advancement or a Reimbursement. Returns a detailed representation of the comment updated.
Parameter
content: | string |
Content
field has support for Emojis. To know more about it, please visit
Emoji section.
You can provide emojis in two forms: as text code (:+1:
, for example) or unicode.
Expired organization
If the organization is expired, it will return an 402 error.
Definition (comment of an Expense)
PUT https://app.rexpense.com/api/v1/expenses/:expense_id/comments/:id
Example Request
$ curl -u $YOUR_API_TOKEN:X -X PUT https://app.rexpense.com/api/v1/expenses/1/comments/2 \ -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -d '{"content":"My updated comment"}'
Example Response Success
HTTP 200 OK
Example Response Failure
HTTP 422 Unprocessable Entity
Definition (comment of an Advancement)
PUT https://app.rexpense.com/api/v1/advancements/:advancement_id/comments/:id
Example Request
$ curl -u $YOUR_API_TOKEN:X -X PUT https://app.rexpense.com/api/v1/advancements/1/comments/2 \ -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -d '{"content":"My updated comment"}'
Example Response Success
HTTP 200 OK
Definition (comment of an Reimbursement)
PUT https://app.rexpense.com/api/v1/reimbursements/:reimbursement_id/comments/:id
Example Request
$ curl -u $YOUR_API_TOKEN:X -X PUT https://app.rexpense.com/api/v1/reimbursements/1/comments/2 \ -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -d '{"content":"My updated comment"}'
Example Response Success
HTTP 200 OK
Example Response Failure
HTTP 422 Unprocessable Entity
Example Response Failure when organization is expired
HTTP 402 Payment Required
Remove a comment
Destroy a comment of an Axpense or an Advancement or a Reimbursement.
Expired organization
If the organization is expired, it will return an 402 error.
Definition (comment of an Expense)
DELETE https://app.rexpense.com/api/v1/expenses/:expense_id/comments/:id
Example Request
$ curl -u $YOUR_API_TOKEN:X -X DELETE https://app.rexpense.com/api/v1/expenses/:expense_id/comments/:id \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Example Response Success
HTTP 204 NO CONTENT
Definition (comment of an Advancement)
DELETE https://app.rexpense.com/api/v1/advancements/:advancement_id/comments/:id
Example Request
$ curl -u $YOUR_API_TOKEN:X -X DELETE https://app.rexpense.com/api/v1/advancements/:advancement_id/comments/:id \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Example Response Success
HTTP 204 NO CONTENT
Definition (comment of an Reimbursement)
DELETE https://app.rexpense.com/api/v1/reimbursements/:reimbursement_id/comments/:id
Example Request
$ curl -u $YOUR_API_TOKEN:X -X DELETE https://app.rexpense.com/api/v1/reimbursements/:reimbursement_id/comments/:id \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Example Response Success
HTTP 204 NO CONTENT
Example Response Failure when organization is expired
HTTP 402 Payment Required