Example requests

Samples on how to make requests

Headers

  1. Content Type: Set content type to application/x-www-form-urlencoded

Requests

1. GET Request

curl -i \
    -H "x-rest-api-key: XXXXXXXX-XXX" \
    -H "x-rest-user: XXXXXXXXXXXXXX" \
    -X GET \
    https://api.pesatime.com/v1/expenses?date_from=2019-01-01

2. POST request

curl -i \
    -H "x-rest-api-key: XXXXXXXX-XXX" \
    -H "x-rest-user: XXXXXXXXXXXXXX" \
    -X POST -d 'name=Category name' \
    https://api.pesatime.com/v1/expense_categories

3. PUT request

curl -i \
    -H "x-rest-api-key: XXXXXXXX-XXX" \
    -H "x-rest-user: XXXXXXXXXXXXXX" \
    -X PUT -d 'name=Category name 2' \
    https://api.pesatime.com/v1/expense_categories/5dce9cea07f72fd690252d74

4. DELETE request

curl -i \
    -H "x-rest-api-key: XXXXXXXX-XXX" \
    -H "x-rest-user: XXXXXXXXXXXXXX" \
    -X DELETE \
    https://api.pesatime.com/v1/expense_categories/5dce9cea07f72fd690252d74

Last updated