Getting 500 Server Error for API Calls

Hello Community,

We are using Asana Python SDK for API Calls to get Stories for the Tasks, but the SDK is throwing 500 error:

asana.error.ServerError: Server Error: Oops! An unexpected error occurred 
    while processing this request. The input may have contained something 
    the server did not know how to handle. For more help, please contact 
    api-support@asana.com and include the error phrase from this response.

The API Calls we are doing are as follows:

  1. Get all Workspaces
  2. Get all Projects in Workspaces
  3. Loop over every every Project and get all Tasks
  4. Get Stories for all the Tasks using SDK function: get_stories_for_task

In the stack-trace we can see the error is coming from get_stories_for_task function of Asana Python SDK.
Please see the Reference for function and API Endpoint.

Can someone help me out with this issue?

Thanks.

Hi,

Any chance to have access to the endpoint called with which params? I am using this endpoint every day successfully…

In the meantime you should do what the message says and send the error phrase to the API team.

Hello, @Bastien_Siebman Thanks for the reply,

Here is the API call:

API Call: /tasks/task_gid/stories

Params: {'limit': 50, 'opt_fields': 'gid,resource_type,created_at,created_by,resource_subtype,text,html_text,is_pinned,assignee,dependency,duplicate_of,duplicated_from,follower,hearted,hearts,is_edited,liked,likes,new_approval_status,new_dates,new_enum_value,new_name,new_number_value,new_resource_subtype,new_section,new_text_value,num_hearts,num_likes,old_approval_status,old_dates,old_enum_value,old_name,old_number_value,old_resource_subtype,old_section,old_text_value,preview,project,source,story,tag,target,task'}

Other Options: {'base_url': 'https://app.asana.com/api/1.0', 'item_limit': None, 'page_size': 50, 'poll_interval': 5, 'max_retries': 5, 'full_payload': True, 'iterator_type': 'items', 'opt_fields': 'gid,resource_type,created_at,created_by,resource_subtype,text,html_text,is_pinned,assignee,dependency,duplicate_of,duplicated_from,follower,hearted,hearts,is_edited,liked,likes,new_approval_status,new_dates,new_enum_value,new_name,new_number_value,new_resource_subtype,new_section,new_text_value,num_hearts,num_likes,old_approval_status,old_dates,old_enum_value,old_name,old_number_value,old_resource_subtype,old_section,old_text_value,preview,project,source,story,tag,target,task', 'timeout': 300, 'limit': 50}

Did you try requesting only for gid for example in the opt_fields just to rule out any issue with that long list of yours?

1 Like