Conventions

The Findity API is very consistent, the same conventions is applied on all resources. In short there are five ways to interact with a resource, getting a single instance, listing, creating, updating and deleting.

A resource is always accessed through its pluralized name. In the examples below the expense resource is used as an example and its access through expenses

Getting a single resource

Getting a single expense is done using GET /expenses/{id}. The response is a JSON document containing the requested document

{
    "id": "da35f675f40e47bcae2fff3c43a94c73",
    "categoryId": "1298d172cb4c4d168c80afe4690f1e73",
    // ...
}

Listing a resource

Listing expenses is done using GET /expenses. The response is a JSON document where the root node contains two nodes, the data node and the meta node. The data node is an array of the objects and each object has the same structure as when fetching a single record. The meta node contains two properties, count which is the number of objects in the data array and total which is the total number of objects, see Pagination for more information.

{
    "data": [
        {
            "id": "498c82d56c18448aa690e9ba66cf2d29",
            // ...
        },
        {
            "id": "c95ee4a966f7477584a30b1e995c266b",
            // ...
        },
        // ...
    ],
    "meta": {
        "count": 10,
        "total": 245
    }
}

Creating a resource

Creating a single expense is done using POST /expenses. The request body should contain a JSON document with the resource that should be created, the structure of the resource should match the structure when fetching the resource. The API will only update the fields that are sent in the payload, so parameters that are not included will be ignored.

{
    "id": "da35f675f40e47bcae2fff3c43a94c73",
    "categoryId": "1298d172cb4c4d168c80afe4690f1e73",
    // ...
}

Updating a resource

Updating a single expense is done using PUT /expenses/{id}. The request body should contain a JSON document with the resource that should be created, the structure of the resource should match the structure when fetching the resource. The API will only update the fields that are sent in the payload, so parameters that are not included will be ignored.

{
    "id": "da35f675f40e47bcae2fff3c43a94c73",
    "categoryId": "1298d172cb4c4d168c80afe4690f1e73",
    // ...
}

Deleting a resource

Deleting a single expense is done using DELETE /expenses/{id}. A delete should not contain a body. Deleting the same resource twice (or deleting a resource that does not exist) you will get a 200 response back.