odesk/python-odesk — Issue #6: client.hr.get_jobs API returns malformed data
Author: mpiette
Created: 2011-11-28 17:42:54+00:00
State: open

The python-odesk get_jobs API returns malformed data...

Code:

```python
for team in team_list:
team_jobs = client.hr.get_jobs(buyer_team_reference = team['reference'],
include_sub_teams= True,
page_size=500)

if 'job' in team_jobs:
for job in team_jobs['job']:
if isinstance(job, dict): # this was necessary as I received a job that wasn't a dictionary...
print "team [%s] buyer_team__reference[%s] - OK" % (team['name'], job['buyer_team__reference'])
else:
print "Incorrect team data returned: [%s]" % job
```

Output:

```text
team [Harvard] buyer_team__reference[449741] - OK
team [Harvard] buyer_team__reference[449741] - OK
team [Locu] buyer_team__reference[427432] - OK
team [Locu] buyer_team__reference[309200] - OK
team [Locu] buyer_team__reference[427432] - OK
team [Locu] buyer_team__reference[427432] - OK
team [1-MIT] buyer_team__reference[427432] - OK
team [1-MIT] buyer_team__reference[427432] - OK
team [1-MIT] buyer_team__reference[427432] - OK
Incorrect team data returned: [attachment_file_url]
Incorrect team data returned: [count_new_applicants]
Incorrect team data returned: [subcategory]
Incorrect team data returned: [reference]
Incorrect team data returned: [created_by_name]
Incorrect team data returned: [job_type]
Incorrect team data returned: [created_time]
Incorrect team data returned: [created_by]
Incorrect team data returned: [duration]
Incorrect team data returned: [last_candidacy_access_time]
Incorrect team data returned: [count_total_candidates]
Incorrect team data returned: [category]
Incorrect team data returned: [buyer_team__reference]
Incorrect team data returned: [title]
Incorrect team data returned: [buyer_company__reference]
Incorrect team data returned: [num_active_candidates]
Incorrect team data returned: [buyer_team__name]
Incorrect team data returned: [buyer_company__name]
Incorrect team data returned: [count_total_applicants]
Incorrect team data returned: [start_date]
Incorrect team data returned: [status]
Incorrect team data returned: [num_new_candidates]
Incorrect team data returned: [description]
Incorrect team data returned: [end_date]
Incorrect team data returned: [public_url]
Incorrect team data returned: [visibility]
Incorrect team data returned: [buyer_team__id]
Incorrect team data returned: [off_the_network]
Incorrect team data returned: [num_candidates]
Incorrect team data returned: [budget]
Incorrect team data returned: [cancelled_date]
Incorrect team data returned: [filled_date]
```