What the hell is a user? Why don't I have one?

Hi Freeagent experts,
I’m hoping you can clarify something to me. I am creating a system that
takes tickets from Freshdesk through their API and (attempting to) create
tasks and timeslips in Freeagent.

Where I’m stuck is in creating a timeslip. I have been able to create a
task in an existing Freeagent project through the API, but not been able to
create a timeslip for a task.

Here are the params I’m sending

Array ( [timeslip] =>
Array (
[user] => ‘https://api.freeagent.com/v2/users/
[project] =>’ https://api.freeagent.com/v2/projects/487389
[task] =>’ https://api.freeagent.com/v2/tasks/487394
=> ‘2013-10-28’
[hours] => ‘3.25’
[comments] =>’’
) )
I’m confident the formatting of the params is correct because when I pass
it an empty array, it gives a different error message: task must be
specified

When I post this, I get responses like User not found for this company and Task
not found for this company. I know how to get the project and task number
but the ‘user’ thing confuses me

If I ping https://api.freeagent.com/v2/users I get an empty result set
(though 200 response), so it appears I don’t have any users. I am assuming
that users are different from contacts. In the freeagent interface there is
no mention of ‘users’. I assume a user is an identity relevant to the API
only? Why would a user be linked to a company as suggested in the error
message??? Do I have to create a user before I can create a timeslip? Why
am I able to create a task in a project, but not a timeslip in a task
without this ‘user’ entity? It makes no sense to me at all.

Could someone illuminate this topic for me?

Hi Andy,

Thanks for getting in touch. You can read about how the API handles users
here:

In short, Users refer to the people who can log into a FreeAgent account
and manipulate the data there. Every FreeAgent account is created with at
least one user, and that user can create more (say for members of staff,
contractors etc).

Timeslips are tied to users, since a given user must have carried out the
work against a task that the timeslip is recording. Tasks, projects etc
don’t have specified users, since in principle any user on the account can
file time against a project’s task.

What looks to be wrong with your timeslip creation request is that the user
field isn’t specifying an actual user who’s filing the timeslip. You’ll
need to get a user’s id as described in the user documentation I’ve linked
above.

The fact that you’re saying the response from that URL is an empty result
set seems odd: can you try again after having read the doc and let me know
if you’re still having the issue? Can you also verify that you can actually
log into the sandbox account that you’re developing against, using the
credentials you provided at that time?

Thanks,

-JOn Monday, 28 October 2013 14:03:34 UTC, Andy Hickey wrote:

Hi Freeagent experts,
I’m hoping you can clarify something to me. I am creating a system that
takes tickets from Freshdesk through their API and (attempting to) create
tasks and timeslips in Freeagent.

Where I’m stuck is in creating a timeslip. I have been able to create a
task in an existing Freeagent project through the API, but not been able to
create a timeslip for a task.

Here are the params I’m sending

Array ( [timeslip] =>
Array (
[user] => ‘https://api.freeagent.com/v2/users/
[project] =>’ https://api.freeagent.com/v2/projects/487389
[task] =>’ https://api.freeagent.com/v2/tasks/487394
[dated_on] => ‘2013-10-28’
[hours] => ‘3.25’
[comments] =>‘’
) )
I’m confident the formatting of the params is correct because when I pass
it an empty array, it gives a different error message: task must be
specified

When I post this, I get responses like User not found for this company and
Task not found for this company. I know how to get the project and task
number but the ‘user’ thing confuses me

If I ping https://api.freeagent.com/v2/users I get an empty result set
(though 200 response), so it appears I don’t have any users. I am assuming
that users are different from contacts. In the freeagent interface there is
no mention of ‘users’. I assume a user is an identity relevant to the API
only? Why would a user be linked to a company as suggested in the error
message??? Do I have to create a user before I can create a timeslip? Why
am I able to create a task in a project, but not a timeslip in a task
without this ‘user’ entity? It makes no sense to me at all.

Could someone illuminate this topic for me?

Thanks Jonathon,
I discovered users in the settings panel and am now set. Thanks.
Andy