<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BAD_REFRESH_TOKEN while trying to refresh token in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/369166#M36371</link>
    <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/139314"&gt;@mateuszg&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please post the post request script that you have written for the refreshing the access token?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 10 Sep 2020 13:13:04 GMT</pubDate>
    <dc:creator>himanshurauthan</dc:creator>
    <dc:date>2020-09-10T13:13:04Z</dc:date>
    <item>
      <title>BAD_REFRESH_TOKEN while trying to refresh token</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/369120#M36370</link>
      <description>&lt;P&gt;Hey:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to refresh a token, but unfortunately, I receive status 400 with:&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;"status"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"BAD_REFRESH_TOKEN"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;"message"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"missing or invalid refresh token"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;"correlationId"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"13aa419f-f7c7-4f2a-85e3-cd837c669576"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;In request I send following params:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;refreh_token: TOKEN&lt;BR /&gt;client_secret: ID&lt;BR /&gt;client_id: SECRET&lt;BR /&gt;grant_type:refresh_token&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have header set to: application/x-www-form-urlencoded;charset=utf-8&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How can I successfully refresh a token?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Sep 2020 11:51:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/369120#M36370</guid>
      <dc:creator>mateuszg</dc:creator>
      <dc:date>2020-09-10T11:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: BAD_REFRESH_TOKEN while trying to refresh token</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/369166#M36371</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/139314"&gt;@mateuszg&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please post the post request script that you have written for the refreshing the access token?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 13:13:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/369166#M36371</guid>
      <dc:creator>himanshurauthan</dc:creator>
      <dc:date>2020-09-10T13:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: BAD_REFRESH_TOKEN while trying to refresh token</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/369917#M36427</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/20405"&gt;@himanshurauthan&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; let refreshTokenResult;

  const requestBody = {
    grant_type: 'refresh_token',
    client_id: clientId,
    client_secret: clientSecret,
    refresh_token: account.remoteConnection.hubspot.accessToken,
  };

  try {
    refreshTokenResult = await rp({
      method: 'post',
      url: 'https://api.hubapi.com/oauth/v1/token',
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
      },
      body: querystring.stringify(requestBody),
    });
  } catch (error) {
    global.logger.error(error);
    throw new Error('Cannot refresh HubSpot access token');
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 14:59:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/369917#M36427</guid>
      <dc:creator>mateuszg</dc:creator>
      <dc:date>2020-09-16T14:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: BAD_REFRESH_TOKEN while trying to refresh token</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/371278#M36546</link>
      <description>&lt;P&gt;Solved it. We were using access_token instead of refresh token to refreshing&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 12:31:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/371278#M36546</guid>
      <dc:creator>mateuszg</dc:creator>
      <dc:date>2020-09-17T12:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: BAD_REFRESH_TOKEN while trying to refresh token</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/374917#M36891</link>
      <description>&lt;P&gt;I just figured out that if there are any new line or invalid characters in the refresh token it gives the error message&amp;nbsp;BAD_REFRESH_TOKEN&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:50:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/374917#M36891</guid>
      <dc:creator>mukundrv</dc:creator>
      <dc:date>2020-09-29T15:50:20Z</dc:date>
    </item>
  </channel>
</rss>

