Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 7025

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 2162

Deprecated: Hook imagify_allow_picture_tags_for_webp is deprecated since version 2.2! Use imagify_allow_picture_tags_for_nextgen instead. in /www/collab365_296/public/wp-includes/functions.php on line 5758
How to test SharePoint / Graph Rest API calls without leaving Visual Studio Code - Collab365
Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1145

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1152

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1155

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1162

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/collab365_296/public/wp-includes/functions.php on line 1165

Warning: Undefined array key "url" in /www/collab365_296/public/wp-content/plugins/thrive-visual-editor/thrive-dashboard/inc/smart-site/classes/class-tvd-smart-shortcodes.php on line 85

2018-05-01

If you’ve ever had to work with the SharePoint, MS Graph API’s then you will know that you need to make plenty of REST calls as you’re developing. One point of frustration for me is constantly having to swap to external tools such as Postman to see what response each REST call returns.

To make my life easier I wanted to find a tool that would allow me to the check the REST response within the VSCode editor, without switching between different tools.

Welcome to the REST Client extension which is available in the Visual Studio Marketplace.

Amongst other benefits, the REST Client extension allows you to fire off a request from within the VSCode editor.

Here’s how to get it working …

Get the Azure AD Domain:

  1. Note down the Azure AD domain as mentioned below from the Azure portal screen.

Install the Rest Client extension:

 

Create a new file (*.http):

Create a request section for each api with the Authorization Header as below.

# @name getclientsidewebparts
GET https://sktechnologies.sharepoint.com/_api/web/getclientsidewebparts HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: {{$aadToken sktechnologiesltd.co.uk}}

###

# @name get user 
GET https://graph.microsoft.com/v1.0/users/kshsbala@sktechnologies.onmicrosoft.com/ HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: {{$aadToken sktechnologiesltd.co.uk}}

###

Send Request:

  • Execute the request using the “Send Request” option.

Sign In to get the response:

Follow the login sequence and the response will be displayed as below.

More details of the RestClient can be found here.

(Visited 548 times, 1 visits today)

About the author 

Balamurugan Kailasam

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 27$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos and 108 Ebooks in the Collab365 Academy. This offer is insane and is only available for a limited period.