0

so I am trying to request an authorization code from smartsheet using postman. I created a new app on my smartsheet with the following url:

app url: https://localhost:3000/

redirect url: https://localhost:3000/callback

so I tried to use the GET https://app.smartsheet.com/b/authorize and input my client id, scope, repsonse_type, and state in postman

the result says there is an error and it did not direct me to a page where I am able to allow authorization.

I am expecting something similar to what the website says (http://smartsheet-platform.github.io/api-docs/#access-levels). I am not sure which part I did was wrong, I am wrong home for this volunteer work hence I do not have an appropriate url. I don't know if it's my urls that are causing the problem or there's something else.

thank you guys in advance

Maggster
  • 51
  • 6

2 Answers2

0

Authorization tokens cannot be generated from the API - you must do them from the website. From the API documentation:

  1. Click the "Account" button in the upper-right corner of the Smartsheet screen, and then click "Personal Settings".
  2. Click the "API Access" tab.
  3. Click the "Generate new access token" button to obtain an access token.
Software2
  • 2,358
  • 1
  • 18
  • 28
0

If you are building out the Smartsheet OAuth flow you will need to have a hosted environment where you can have requests sent and be able to open a page in a browser to authenticate to the Smartsheet account and select the Allow button to confirm the access token should be created and returned to your application.

For development purposes you can use a service like ngrok to create a publicly available URL for your localhost which will allow you to send and receive the necessary data from Smartsheet in your development environment.

daveskull81
  • 627
  • 4
  • 7
  • so I have created an url from https://www.000webhost.com/migrate?static=true, I got an url with https://xxxxxxx. I inputted this url as my app url, and keep my redirect url as https://localhost:3000/callback. I am still not getting the page where it asks me to authenticate the account. – Maggster May 08 '19 at 03:44
  • The URL you give for the app and the callback need to be at a domain you control and can send and receive data from. Using ngrok you can have a unique URL to connect to your localhost. Then you can use that in your app URL and callback URL. – daveskull81 May 09 '19 at 23:39
  • hi, I really appreciate your patient and please forgive me for asking too many questions as I am completely new to url. so I signed into ngrok, and followed the installation instruction. when I typed http://localhost:4040/status, it shows me the url and my local host port. Should I put the url (xxxx.ngrok.io) as the app url and localhsot:443/callback as my redirect url?? I tried this and did not see the authorization page. – Maggster May 10 '19 at 06:05
  • You would put the url from ngrok as your app url. Then if you will be using /callback for your callback url you put /callback onto the end of the ngrok url and enter that as the callback url in Smartsheet. Once that is done you can build out the route in your application for /callback and when requests are sent to the nrgok url /callback it will be brough down to your localhost at that path. – daveskull81 May 10 '19 at 23:47