SharePoint online REST API access from postman

%3CLINGO-SUB%20id%3D%22lingo-sub-1212874%22%20slang%3D%22en-US%22%3ESharePoint%20online%20REST%20API%20access%20from%20postman%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1212874%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20have%20registered%20SharePoint%20addin%20in%20azure%20and%20granted%20admin%20consent%20to%20the%20app.%20I%20am%20able%20to%20generate%20token%20in%20postman%20by%20specifying%20client%20credentials%20and%20resource%20details%20and%20the%20received%20token%20contain%20has%20got%20%22Site.Read.All%22%20role%20(token%20obtained%20from%26nbsp%3B%3CSPAN%3Eaccounts.accesscontrol.windows.net)%3C%2FSPAN%3E.%20But%20in%20the%20subsequent%20SharePoint%20REST%20API%20call%20to%20fetch%20the%20list%20details%20using%20this%20token%20%2C%20I%20am%20getting%20403%20Forbidden%20error.%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20requirement%20is%20to%20get%20all%20the%20image%20files%20within%20a%20SharePoint%20list%20using%20javascript.%3C%2FP%3E%3CP%3E.Can%20anyone%20help%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1213920%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20online%20REST%20API%20access%20from%20postman%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1213920%22%20slang%3D%22en-US%22%3E%3CP%3EHey%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F575775%22%20target%3D%22_blank%22%3E%40reshk1950%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20you%20need%20to%20register%20an%20application%20to%20use%20SharePoint%20or%20are%20you%20just%20trying%20to%20query%20SharePoint%20from%20Postman%3F%20If%20you%20want%20to%20make%20some%20REST%20queries%20and%20that's%20it%2C%20the%20fastest%20way%20would%20be%20to%3A%3C%2FP%3E%3CUL%3E%3CLI%3EOpen%20a%20SharePoint%20page%20with%20your%20browser's%20Developer%20tools(F12)%20open.%3C%2FLI%3E%3CLI%3EGo%20to%20the%20Network%20section%20and%20select%20the%20first%20request%20in%20the%20list(your%20page's%20request%2C%20with%20the%20URL%20you%20typed).%3C%2FLI%3E%3CLI%3EIn%20the%20Headers%20section%20of%20the%20request%2C%20expand%20the%20Request%20Headers%20parameter%3C%2FLI%3E%3CLI%3EYou%20will%20see%20some%20parameters%20being%20list.%20Go%20to%20the%20'cookie'%20parameter%20and%20copy%20the%20cookies%20'rtFa'%20and%20'FedAuth'%3C%2FLI%3E%3CLI%3EPaste%20these%20cookies%20in%20the%20Header%20of%20your%20Postman%20request.%20You%20should%20be%20able%20to%20make%20REST%20calls%20to%20SharePoint%20now%3C%2FLI%3E%3C%2FUL%3E%3CP%3EOf%20course%2C%20if%20you%20need%20to%20register%20an%20application%20you%20would%20have%20to%20go%20a%20lot%20deeper%20than%20this.%20Let%20me%20know%20if%20it%20helps.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3CP%3E%2C%26nbsp%3B%20go%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi,

I have registered SharePoint addin in azure and granted admin consent to the app. I am able to generate token in postman by specifying client credentials and resource details and the received token contain has got "Site.Read.All" role (token obtained from accounts.accesscontrol.windows.net). But in the subsequent SharePoint REST API call to fetch the list details using this token , I am getting 403 Forbidden error. 

My requirement is to get all the image files within a SharePoint list using javascript.

.Can anyone help? 

1 Reply

Hey @reshk1950 ,

 

So, you need to register an application to use SharePoint or are you just trying to query SharePoint from Postman? If you want to make some REST queries and that's it, the fastest way would be to:

  • Open a SharePoint page with your browser's Developer tools(F12) open.
  • Go to the Network section and select the first request in the list(your page's request, with the URL you typed).
  • In the Headers section of the request, expand the Request Headers parameter
  • You will see some parameters being list. Go to the 'cookie' parameter and copy the cookies 'rtFa' and 'FedAuth'
  • Paste these cookies in the Header of your Postman request. You should be able to make REST calls to SharePoint now

Of course, if you need to register an application you would have to go a lot deeper than this. Let me know if it helps.

 

Regards

,  go