# Removing whitespace from request

**URL:** <https://community.postman.com/t/removing-whitespace-from-request/34193>\
**Category:** Help Hub\
**Tags:** authentication, request, oauth2\
**Created:** [April 4, 2022, 9:17am UTC](https://community.postman.com/t/removing-whitespace-from-request/34193 "2022-04-04T09:17:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![robynp31](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/robynp31/32/11650_2.png) [@robynp31](https://community.postman.com/u/robynp31)\
**Post date:** [April 4, 2022, 9:17am UTC](https://community.postman.com/t/removing-whitespace-from-request/34193/1 "2022-04-04T09:17:40Z")

</div>

Hi all,

I am just getting started with postman, and thought it would be a good idea to integrate with the Google Calendar API.

I got the POST part of the request right and it is returning a bearer token as expected. My issue comes in with the second GET request;

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/a/a96a2bdb494d2e5e4f2d89bce461effb90f48646.png)

It returns 401 authentication error.

I have done some more investigation and believe whitespace to be the issue;

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/7/1/71a0349a9f6b3fa23756a209332d42d9f27333cd.png)

As can be seen from the cURL, it appears that Postman is automatically adds whitespace between the key-value pairs of the request. I have checked my entries and can find no whitespace there…

So my question is; is there a way to remove this whitespace that is added into my request before sending it?

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [April 4, 2022, 9:33am UTC](https://community.postman.com/t/removing-whitespace-from-request/34193/2 "2022-04-04T09:33:13Z")

</div>

Hi @robynp31

Looking at your screenshots, I suspect your bearer token is invalid, the header section looks too short.

How are you building your token?

---

<div class="post-metadata">

**Author:** ![robynp31](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/robynp31/32/11650_2.png) [@robynp31](https://community.postman.com/u/robynp31)\
**Post date:** [April 4, 2022, 9:47am UTC](https://community.postman.com/t/removing-whitespace-from-request/34193/3 "2022-04-04T09:47:15Z")

</div>

Hi w4dd325,

I obtained my bearer token from the first API call;

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/b/3/b3c4806429b1335e3cca29ddaecc825d3c5cb992.png)

Added header values according to an online guide😅

> **[Get Access Token From Google Calendar API Through Postman | Salesforce...](https://www.forcetalks.com/blog/get-access-token-from-google-calendar-api-through-postman-salesforce-developer-guide/)**
>
> Get Access token from Google Calendar API through Postman While working with integration with third parties, it is very very important to get the access…

My suspicion is that the bearer token is incorrectly read due to the whitespace preceding it?

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [April 4, 2022, 10:12am UTC](https://community.postman.com/t/removing-whitespace-from-request/34193/4 "2022-04-04T10:12:26Z")

</div>

Does the curl command work if you send it from elsewhere?

for example; [Run Curl Commands Online](https://reqbin.com/curl)

---

<div class="post-metadata">

**Author:** ![robynp31](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/robynp31/32/11650_2.png) [@robynp31](https://community.postman.com/u/robynp31)\
**Post date:** [April 4, 2022, 10:24am UTC](https://community.postman.com/t/removing-whitespace-from-request/34193/5 "2022-04-04T10:24:23Z")

</div>

Unfortunately not. It now returns error code 403  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/9/a/9a6c8a1b12ac1716e7972326ede60d025f8b3e12.png)

{  
“error”: {  
“code”: 403,  
“message”: “Request had insufficient authentication scopes.”,  
“errors”: [{  
“message”: “Insufficient Permission”,  
“domain”: “global”,  
“reason”: “insufficientPermissions”  
}],  
“status”: “PERMISSION\_DENIED”,  
“details”: [{  
“@type”: “[type.googleapis.com/google.rpc.ErrorInfo](http://type.googleapis.com/google.rpc.ErrorInfo)”,  
“reason”: “ACCESS\_TOKEN\_SCOPE\_INSUFFICIENT”,  
“domain”: “[googleapis.com](http://googleapis.com)”,  
“metadata”: {  
“method”: “calendar.v3.Calendars.Get”,  
“service”: “[calendar-json.googleapis.com](http://calendar-json.googleapis.com)”  
}  
}]  
}  
}

---

<div class="post-metadata">

**Author:** ![robynp31](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/robynp31/32/11650_2.png) [@robynp31](https://community.postman.com/u/robynp31)\
**Post date:** [April 4, 2022, 10:37am UTC](https://community.postman.com/t/removing-whitespace-from-request/34193/6 "2022-04-04T10:37:07Z")

</div>

Found my issue.  
The scope for my bearer token was _[www.googleapis.com/auth/drive](http://www.googleapis.com/auth/drive)_  
The scope I needed for my GET request is _[www.googleapis.com/auth/calendar](http://www.googleapis.com/auth/calendar)_

Both request work without issue now.  
Thank you so much for your assistance!😁

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [April 4, 2022, 10:37am UTC](https://community.postman.com/t/removing-whitespace-from-request/34193/7 "2022-04-04T10:37:28Z")

</div>

Hmmm …

I read the docs and I’m not sure…  
But here are 2 workspaces that you could fork, they appear to have set up Google Calendar API’s;

[Link 1](https://www.postman.com/interstellar-station-205646/workspace/api-google-calendar/request/20305151-872ef4a7-03c3-4a24-b7ae-a97c995fb9fc)

[Link 2](https://www.postman.com/VitaliiYatsyshyn/workspace/google-calendar-reminders/request/10303875-282be081-824a-47d5-8ad1-191b88d4d207)
