# Making your first API call

In order to start making calls to the API, you will need to attach your credentials to each request as an Authorization header.

Civillo API expects your credentials to be formatted in a certain way in order to process your request; the string 'Bearer ', followed by the base64 representation of your key/secret pair, seperated by a : colon. In NodeJS, for example, this might look a bit like this:

const token = "Bearer " + Buffer.from(`${YOUR_API_KEY}:${YOUR_API_SECRET}`).toString('base64');

Once you have your bearer token you can start making calls to the API.

const result = await fetch("https://app.civillo.com/api/v1/applications", 
    {
        method: "GET",
        headers: { 'Authorization': token }
    }
);

And if everything goes to plan, you should receive a 200 OK response with a json result that looks something like this:

[
    {
        "name": "My organization",
        "nickname": "myorg"
    }
]

Using this nickname value, you can start building requests that query data specific to that organization. For example:

const result = await fetch("https://app.civillo.com/api/v1/myorg/projects", 
    {
        method: "GET",
        headers: { 'Authorization': token }
    }
);

Result:

[
    {
        "id": 1,
        "name": "Default Project"
    },
    {
        "id": 2,
        "name": "Second Project"
    },
    {
        "id": 3,
        "name": "Another Project"
    }
]
Last Updated: 04/08/2023