# Getting a 403 from response.status\_code when trying to make a request from the API with requests.get

**URL:** <https://forum.asana.com/t/getting-a-403-from-response-status-code-when-trying-to-make-a-request-from-the-api-with-requests-get/303588>\
**Category:** API & Developers\
**Created:** [12 January 2023 10:12 UTC](https://forum.asana.com/t/getting-a-403-from-response-status-code-when-trying-to-make-a-request-from-the-api-with-requests-get/303588 "2023-01-12T10:12:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon29617456](https://luna1.co/8d76cd.png) [@anon29617456](https://forum.asana.com/u/anon29617456)\
**Post date:** [12 January 2023 10:12 UTC](https://forum.asana.com/t/getting-a-403-from-response-status-code-when-trying-to-make-a-request-from-the-api-with-requests-get/303588/1 "2023-01-12T10:12:35Z")

</div>

Hey there everyone,

I need help with an error that i’m getting from trying to make a request.get to get the tasks of a project from the API Asana.  
please find the code sample below.  
Thank you for your help in advance

import asana  
import requests  
import json  
import pandas as pd

asana\_api\_key = “{personal\_Asana\_Token}”  
headers = {“Authorization”: f"Bearer {asana\_api\_key}"}  
client = asana.Client.access\_token(asana\_api\_key)  
me = [client.users.me](http://client.users.me)()  
print(me)

project\_id = {project\_Id}  
response = requests.get(f"[Log in - Asana](https://app.asana.com/0/%7Bproject_id%7D/tasks)", headers=headers, params=“value”)  
tasks = response.json()[“data”]

---

<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 January 2023 06:17 UTC](https://forum.asana.com/t/getting-a-403-from-response-status-code-when-trying-to-make-a-request-from-the-api-with-requests-get/303588/2 "2023-01-13T06:17:29Z")

</div>

hi Adiba it’s me 👋

I realised your endpoint might be wrong.  
If you look at the doc: [https://developers-beta.asana.com/reference/gettasksforproject](https://developers-beta.asana.com/reference/gettasksforproject)

The endpoint is `https://app.asana.com/api/1.0/projects/{project_gid}/tasks`, it looks like you are missing the `/projects` isn’t it?

---

<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 January 2023 06:17 UTC](https://forum.asana.com/t/getting-a-403-from-response-status-code-when-trying-to-make-a-request-from-the-api-with-requests-get/303588/3 "2023-01-13T06:17:55Z")

</div>

and also missing the `/api/1.0`…

---

<div class="post-metadata">

**Author:** ![anon29617456](https://luna1.co/8d76cd.png) [@anon29617456](https://forum.asana.com/u/anon29617456)\
**Post date:** [13 January 2023 15:32 UTC](https://forum.asana.com/t/getting-a-403-from-response-status-code-when-trying-to-make-a-request-from-the-api-with-requests-get/303588/4 "2023-01-13T15:32:55Z")

</div>

Hello Bastien,

So after your answer and looking at the documentation I figured that i was targeting the wrong endpoint.  
After changing it based on what you said it worked just fine.

Thank you very much for your help 😄

---

<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 18:55 UTC](https://forum.asana.com/t/getting-a-403-from-response-status-code-when-trying-to-make-a-request-from-the-api-with-requests-get/303588/5 "2025-05-30T18:55:56Z")

</div>

Closed on 30 May 2025 18:55 UTC


