Back to oDesk.com » Love the way you work.

Welcome to the oDesk Community! Connect here with fellow clients, contractors, and oDesk staff. Please review our Usage Policy.

TimeReports API - "You have no access to this time report"

Everytime I try to retrieve data from the TimeReports API, it returns "You have no access to this time report".

For example,

https://www.odesk.com/gds/timereports/v1/companies/806033?tq=SELECT+week_worked_on%2C+assignment_team_id%2C+sum%28hours%29%2C+sum%28charges%29+WHERE+worked_on+%3E+%272013-01-01%27+AND+worked_on+%3C%3D+%272013-01-07%27&tqx=out:xml

Returns

<?xml version="1.0" encoding="utf-8"?> 0.6errorunauthorizedYou have no access to this timereport

The value 806033 is the "reference" That is returned from

https://www.odesk.com/api/hr/v2/companies.xml which works correctly using OAuth.

Any Ideas?

Vote Result

----------
Score: 0.0, Votes: 0
Hello Steve,thank you for

Hello Steve,

thank you for choosing oDesk API!

Please, note that documentation says - 'https://www.odesk.com/gds/timereports/v1/companies/{company}', and has an example 'https://www.odesk.com/gds/timereports/v1/companies/mycompanyid?tq=SELECT week_worked_on, assignment_team_id, sum(hours), sum(charges) WHERE worked_on > '2009-10-01' AND worked_on <= '2009-10-31'&tqx=out:json'

but in your request you use reference id instead of company id.

Getting the company id

Hi Maksym,

Thanks. What is the company id and what is the best way to programmatically get the company id? The call to https://www.odesk.com/api/hr/v2/companies.xml

returns reference but not id.

See: http://developers.odesk.com/w/page/23885423/Company%20Object

Thanks.
Steve.

From documentation -

From documentation - '{company} The company ID (where to get?)', please follow the link to find out the answer.

If you have already implemented Team API, there is https://www.odesk.com/api/hr/v2/teams.xml that returns company and team ids.

Still No Company ID

Hi Maksym,

I've looked at the link you suggested and I don't see any reference to company id in the API.

It only returns these fields as per this documentation: http://developers.odesk.com/w/page/23885458/Team%20Object

I see team id, but not company id, only the reference.

I also tried this API
http://developers.odesk.com/w/page/12364016/Team%20API
( https://www.odesk.com/api/team/v2/teamrooms )

and it doesn't return a company id either.

Steve.

Steve,doesn't a response has

Steve,

doesn't a response have 'id: "..."' inside of tag 'teamroom'?

Still no company id

Hi Maksym,

There is an 'id' in the teamroom XML but it's the team id and not the company id.

The doc for teamrooms says there is a company_recno that is a unique number to identify the current company.

However, when I call that API company_recno is not returned.

Steve.

"id" is what you need, it

"id" is what you need, it should be smth like "myliteralid".
Please, contact apisupport and provide full request with details, in case you still can not find needed data (I just can not post here your privat data).