Skip to content

Instantly share code, notes, and snippets.

@stinaq
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stinaq/e8f1884b515402ef650c to your computer and use it in GitHub Desktop.
Save stinaq/e8f1884b515402ef650c to your computer and use it in GitHub Desktop.
The most basic Rest call to SharePoint using Postman

Getting authenticated

Type in

http://yoursite/_api/contextinfo

into the input field and make sure it's a POST-request. Now we need to add a header, to tell SharePoint what kind of data we want back, so click on the "Headers" button at the top right corner. At the left side on the new lines that appear, enter Accept. At the right side enter application/json; odata=verbose. It should now look something like this:

Then click send and you get the results back. Copy the FormDigestValue, which is a really long string ending with a date and time. Mine looked like this:

0x67E193EA3576EA9F58DF19A5F61645EDC6457DB3D09629DE51737EBCC8FEB5F11045E34F78FA6E9C2A63E4A68BA1CC46C806D630F7C81DD7D9BC703AB29B9677,1 Feb 2014 12:01:57 -0000

Getting data

Change the URL to, for example,

http://yoursite/_api/web

and it should still be a POST-request. The accept-header should look the same, but now you need to add the FormDigestValue as another header. To the left, enter X-RequestDigest and to the right enter the value you copied before. Then all you have to do is click send, and the data appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment