Trouble specifying "id"

Hi

I am new to the FreeAgent API and trying to find my way. I am working on some python code for automating a few things. I have figured out the OAuth stuff and am able to list content from the database. I am having trouble formatting the requests for getting specific entries and for creating new entries. For example:

to Get a single bill the docs give: GET https://api.freeagent.com/v2/bills/:id

Can anyone tell me what is the “id” in this case. There is no “id” field in the list elements returned by “list all bills”. Is this “id” supposed to be set to the url field in the list elements? I have tried this without success.

Could anyone post an example valid request or url encoding for this?

Thanks

R

The id is the number which is the last part of the entity’s URL. For example, in the docs for “Get a single bill”, the bill’s URL is “https://api.freeagent.com/v2/bills/1” – and so its id is 1.

Thanks Andrew

So when I list all bills I get a response that includes this key value pair: “url”: “https://api.sandbox.freeagent.com/v2/bills/16163

Based on your email the id is “16163”.

So then I make a request to: https://api.sandbox.freeagent.com/v2/bills/:16163
with same headers that work for the list command:
{
“Accept”: “application/json”,
“Authorization”: “Bearer …”,
“Content-Type”: “application/json”
}

The above gives a 404 Not Found response.

Where am I going wrong?

Thanks

Try https://api.sandbox.freeagent.com/v2/bills/16163, i.e. without the colon.