Skip to main content
Question

Programmatically Fetching Access & Refresh Tokens

  • May 22, 2025
  • 1 reply
  • 22 views

Forum|alt.badge.img

I'm trying to run a curl of:

curl -i -X GET "https://account.box.com/api/oauth2/authorize?response_type=code&client_id=x&redirect_uri=https://google.com"

Which sends back 

Error: redirect_uri_mismatch

From the manual (https://developer.box.com/guides/applications/custom-apps/oauth2-setup/#section-2-the-first-leg) I'm not clear what the redirect URI should be here if I'm trying to approach fetching access and refresh tokens programmatically.

1 reply

Forum|alt.badge.img

Hi! 

According to this reference page, the redirect URI in the dev console (screenshot below) has to match the URI in the API call. BOX1_WX2Wb9zMfFR2Ku3V1sFU6Q.png

Thanks!

Alex, Box Developer Advocate