# Getting 500 Server Error for API Calls

**URL:** <https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507>\
**Category:** API & Developers\
**Tags:** api\
**Created:** [3 May 2022 12:47 UTC](https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507 "2022-05-03T12:47:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Sloane](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/brian_sloane/32/101204_2.png) [@Brian\_Sloane](https://forum.asana.com/u/Brian_Sloane)\
**Post date:** [3 May 2022 12:47 UTC](https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507/1 "2022-05-03T12:47:41Z")

</div>

Hello Community,

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

```auto
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](https://github.com/Asana/python-asana/blob/e163de2b94a42d84320342aeedaf7fcec014a299/asana/resources/gen/stories.py#L35) for function and API Endpoint.**

Can someone help me out with this issue?

Thanks.

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [4 May 2022 05:00 UTC](https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507/2 "2022-05-04T05:00:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Brian\_Sloane](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/brian_sloane/32/101204_2.png) [@Brian\_Sloane](https://forum.asana.com/u/Brian_Sloane)\
**Post date:** [4 May 2022 08:57 UTC](https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507/3 "2022-05-04T08:57:01Z")

</div>

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}`

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [5 May 2022 05:23 UTC](https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507/4 "2022-05-05T05:23:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Brian\_Sloane](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/brian_sloane/32/101204_2.png) [@Brian\_Sloane](https://forum.asana.com/u/Brian_Sloane)\
**Post date:** [3 June 2022 05:32 UTC](https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507/5 "2022-06-03T05:32:08Z")

</div>

Thanks, @Bastien_Siebman. We want all these fields in our integration so, we are providing the fields list in the API call. Only `gid` is not useful for integration.

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [3 June 2022 06:36 UTC](https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507/6 "2022-06-03T06:36:28Z")

</div>

My point was to isolate a possible issue with a value in your list. If requesting the gid only works, you can then request more and more fields until it breaks. Wouldn’t it help debug?

---

<div class="post-metadata">

**Author:** ![Brian\_Sloane](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/brian_sloane/32/101204_2.png) [@Brian\_Sloane](https://forum.asana.com/u/Brian_Sloane)\
**Post date:** [3 June 2022 07:14 UTC](https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507/7 "2022-06-03T07:14:55Z")

</div>

Got your point @Bastien_Siebman. Actually, we are not facing an error in our account but one of our support account so we will pass this message forward to our end.

---

<div class="post-metadata">

**Author:** ![Brian\_Sloane](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/brian_sloane/32/101204_2.png) [@Brian\_Sloane](https://forum.asana.com/u/Brian_Sloane)\
**Post date:** [13 June 2022 11:54 UTC](https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507/8 "2022-06-13T11:54:19Z")

</div>

@Bastien_Siebman Did you get chance to look into this?

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [13 June 2022 12:13 UTC](https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507/9 "2022-06-13T12:13:35Z")

</div>

I don’t work for Asana so I can’t look into anything 😬

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/system/32/276370_2.png) [@system](https://forum.asana.com/u/system)\
**Post date:** [30 May 2025 19:04 UTC](https://forum.asana.com/t/getting-500-server-error-for-api-calls/163507/10 "2025-05-30T19:04:01Z")

</div>


