cors_origin_not_whitelisted error, while making Rest api call on Get Box folder using javascript

Highlighted
New Contributor

cors_origin_not_whitelisted error, while making Rest api call on Get Box folder using javascript

Hi Friends,

 

I have developed javascript code to access  box with JWT authentication. And able to get the JWT token. I am trying to make Rest api call to Get Box List items in folder (https://api.box.com/2.0/folders/:folder_id/items), and getting below error, even after adding the origin as it is in the cors allowance in the developers console.

 

 

{"type":"error","status":403,"code":"cors_origin_not_whitelisted","context_info":{"origin":"https:\/\/egul-dev1.fa.us2.oraclecloud.com"},"help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Access denied - Did you forget to whitelist your origin in the CORS config of your app?","request_id":"ysvqbpgghct14rvv"}

 

Please someone guide us how to solve this issue.

 

Thanks.

1 REPLY 1
Highlighted
Box Employee

Re: cors_origin_not_whitelisted error, while making Rest api call on Get Box folder using javascript

Hi @rsamineni321,

 

Is it possible that the request is being routed through a different port or subdomain? If so that would cause the issue and would need to be added to the allowlist as well. 

 

- Jon