Skip to main content
Question

Unable to do auth 2.0 from salesforce . (The only available option for us is through JWT.)

  • May 22, 2025
  • 3 replies
  • 20 views

Forum|alt.badge.img

When I create access token with JWT I am getting invalid or insufficient permissions on to upload file or create folder, or that I need an app that I can use the Client ID and secret that lets me do actions like POST and PUT  (for create folder, generate share link id, upload folders, update folder) .

I was able to create an app but I don’t know what I am missing. To do all the above actions.

3 replies

Forum|alt.badge.img

Hello, 

It would be most helpful if you could supply the api key (aka client ID) of your app, the error you received for invalid or insufficient permissions, and an example date/time/timezone you received it so I can take a closer look within our backend logs. If I had to take a guess at the issue, since you're using JWT, the default token used is going to be associated with the application's service account. This account will not have any access to existing content until you add them as a collaborator. Just like in the webapp, you're only going to successfully be able to interact with content the user associated with your token either owns or has collaborator access to. You can confirm who your token is associated with by using the get current user endpoint

Best, 

Kourtney, Box Developer Advocate


Forum|alt.badge.img

HI,

Thank you for the feedback. Here is the information you requested.

 

 

        clientId = 'prg0gct7dvijuu0oktuw326i8j3x5q3z';

        endpoint = 'https://api.box.com/oauth2/token';

      Enterprise Id= '784103840';

Endpoint=https://api.box.com/2.0/folders?fields=id,type,name,folder_upload_email, Method=POST]

18:49:49:549 CALLOUT_RESPONSE [125]|System.HttpResponse[Status=Forbidden, StatusCode=403]

18:49:49:549 CALLOUT_RESPONSE [125]|System.HttpResponse[Status=Forbidden, StatusCode=403]

 

Time: 6:50PM PST --01/06/2020


Forum|alt.badge.img

Thanks for the info! This 403 is being cause by sending "sync_state":"synced" in the body. You're not going to be able to do that on a folder creation call. You'll need to make a secondary PUT call to update the folder once its created. Please give that a try and let me know how it goes!