Issue with File Download using OAuth2 Authorization - Receiving 404 Not Found
AnsweredHello Box Community,
I am currently working on a project that involves downloading audio files from Box using an audio URL. My process involves authorizing with Box using OAuth2 and then attempting to download the file. Here are the steps I am following:
-
Authorization:
- I am using a POST request to authenticate with Box using OAuth2. The request includes the following parameters:
grant_type
,client_id
,client_secret
,box_subject_id
, andbox_subject_type
. - The authorization process completes successfully, and I receive the access token.
- I am using a POST request to authenticate with Box using OAuth2. The request includes the following parameters:
-
Retrieving File Information:
- I use a GET request to the following endpoint to retrieve the file information:
https://api.box.com/2.0/shared_items?shared_link=${shared_link}
- This request works correctly, and I am able to obtain the file ID and other details.
- I use a GET request to the following endpoint to retrieve the file information:
-
Downloading the File:
- I attempt to download the file using a GET request to this endpoint:
https://api.box.com/2.0/files/:file_id/content?access_token=${accessToken}
- I ensure that both the access token and file ID are correctly included in the request.
- I attempt to download the file using a GET request to this endpoint:
Despite following these steps, I consistently receive a 404 Not Found response when attempting the file download.
Has anyone encountered a similar issue or can provide guidance on what might be going wrong? I would appreciate any insights or suggestions for resolving this problem.
Thank you for your assistance.
Please sign in to leave a comment.
Comments
1 comment