Note
Every method is fully documented in the docstring, so you can refer to the Reference Documentation: Classes and Methods or directly view help in the interactive console.
To get help on the method use:
help(client.provider.search_jobs)
or if you use IPython just add ? symbol at the end of an object/class/method:
client.provider.search_jobs?
https://developers.odesk.com/?lang=python#authentication
To authenticate your web application with the python-odesk, use something similar to the code below:
public_key = raw_input('Please enter public key: > ')
secret_key = raw_input('Please enter secret key: > ')
#Instantiating a client without an auth token
client = odesk.Client(public_key, secret_key)
print "Please to this URL (authorize the app if necessary):"
print client.auth.get_authorize_url()
print "After that you should be redirected back to your app URL with " + \
"additional ?oauth_verifier= parameter"
verifier = raw_input('Enter oauth_verifier: ')
oauth_access_token, oauth_access_token_secret = \
client.auth.get_access_token(verifier)
# Instantiating a new client, now with a token.
# Not strictly necessary here (could just set `client.oauth_access_token`
# and `client.oauth_access_token_secret`), but typical for web apps,
# which wouldn't probably keep client instances between requests
client = odesk.Client(public_key, secret_key,
oauth_access_token=oauth_access_token,
oauth_access_token_secret=oauth_access_token_secret)
https://developers.odesk.com/?lang=python#public-profiles_get-brief-profile-summary https://developers.odesk.com/?lang=python#public-profiles_get-profile-details
To get information about freelancer, use following methods (click the link to see detailed description of parameters):
To search for a freelancer (https://developers.odesk.com/?lang=python#public-profiles_search-for-freelancers) by the query string, use:
To search jobs(https://developers.odesk.com/?lang=python#jobs_search-for-jobs) by the query string, use:
To get information about available categories, skills, regions and tests use:
client.provider.get_categories_metadata
client.provider.get_skills_metadata
oDesk Hiring API https://developers.odesk.com/?lang=python#contracts-and-offers allows to do such tasks as:
https://developers.odesk.com/?lang=python#jobs_get-job-profile
To work with jobs you should use client.job wrapper:
tasks = client.job.get_job_profile(job key)
Where:
https://developers.odesk.com/?lang=python#companies-and-teams
After authentication, you can get teams’ information from client instance you have:
To get snapshots:
To get user’s workdiaries inside the team:
https://developers.odesk.com/?lang=python#messages
Get user’s trays (if user not provided, authenticated user will be taken):
Get content of the tray:
Get content of the thread:
https://developers.odesk.com/?lang=python#reports_time-reports-fields
To get timereports, use, based on the level of the timereports you need:
client.timereport.get_provider_report
Below is an example how to construct a GDS query:
client.timereport.get_provider_report('user1',
odesk.utils.Query(select=odesk.utils.Query.DEFAULT_TIMEREPORT_FIELDS,
where=(odesk.utils.Q('worked_on') <= date.today()) &\
(odesk.utils.Q('worked_on') > '2010-05-01')))
client.timereport.get_provider_report('user1',
odesk.utils.Query(select=odesk.utils.Query.DEFAULT_TIMEREPORT_FIELDS,
where=(odesk.utils.Q('worked_on') <= date.today()) &\
(odesk.utils.Q('worked_on') > '2010-05-01')), hours=True)
client.timereport.get_agency_report('company1', 'agency1',
odesk.utils.Query(select=odesk.utils.Query.DEFAULT_TIMEREPORT_FIELDS,
where=(odesk.utils.Q('worked_on') <= date.today()) &\
(odesk.utils.Q('worked_on') > '2010-05-01')), hours=True)
https://developers.odesk.com/?lang=python#reports_financial-reports-fields
Financial reports are also using GDS queries.
Please see Finreports wrapper
https://developers.odesk.com/?lang=python#activities
To work with Activities you should use client.task wrapper:
tasks = client.task.get_team_tasks('your_company_id', 'your_team_id')
Note, that company_id here is basically a parent_team__id value from the hr.get_team() API call.
Methods to get activities:
client.task.get_team_specific_tasks
client.task.get_company_specific_tasks
Create and update activities:
Archive/unarchive activities:
client.task.archive_company_task
client.task.unarchive_team_task
client.task.unarchive_company_task
Assign activities to the contractor’s engagement: