Get started with Monitask API
Steps to get started with Monitask API:
- Navigate to the https://app.monitask.com/developer (developer) page and click “Add new app” button.
![](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image.pngw3.webp)
- You will be redirected to application registration page where you’ll need to specify basic details for your app:
![Graphical user interface, application, Teams Description automatically generated](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image.pngw3.webp)
Fill App Name and Redirect Uri, optionally fill Logo Uri and Website Uri and click Create.
- Now you are redirected to the app details page. You will also be able to access it from developer page later
![Graphical user interface, application Description automatically generated](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-3.pngw3.webp)
Here you can manage redirect uris, scopes and secrets of your app
- Click Add Secret button
![Graphical user interface, text, application Description automatically generated](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-1.pngw3.webp)
Then copy it and save securely. You will not be able to obtain this secret again
![](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image.pngw3.webp)
- Add openid scope and click Save
![Graphical user interface, text, application Description automatically generated](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-3.pngw3.webp)
- Copy Client Id from this page
![Graphical user interface, text, application, Teams Description automatically generated](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-2.pngw3.webp)
- Then, you can build an OAuth URL with the following structure:
https://app.monitask.com/identity/connect/authorize?client_id=<yourclientid>&scope=<your_scopes> &response_type=code&redirect_uri=<your_redirect_uri>
Example of such URL:
https://app.monitask.com/identity/connect/authorize?client_id=437bfbf0d2fd41479e671cdf643aa5ad&scope= profile%20email%20openid%20offline_access%20ExternalApi&response_type=code&redirect_uri=http://localhost:5000/monitask/callback
- When you open this URL you will see a Monitask sign in page:
![Graphical user interface, application, Teams Description automatically generated](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-3.pngw3.webp)
Sign in to your account
You will be redirected to your application permissions page:
![Graphical user interface, application, Teams Description automatically generated](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-5-1024x649.pngw3.webp)
Click Yes, Allow
- You are redirected to the specified redirect_url with oauth code:
![](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-3.pngw3.webp)
- You can make an HTTP POST request to the https://app.monitask.com/identity/connect/token with the following data:
Basic Auth. Username is your client_id, Password is your client_secret
![Graphical user interface, text Description automatically generated](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-4.pngw3.webp)
Body is form-urlencoded with grant_type=authorization_code, redirect_uri is your redirect_uri and code is the code you obtained in oauth dance
![A screenshot of a computer Description automatically generated with medium confidence](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-6.pngw3.webp)
When you execute this request you obtain access_token and refresh_token
![A screenshot of a computer screen Description automatically generated with medium confidence](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-7-1024x518.pngw3.webp)
- You can use obtained access_token for querying our API:
Add it as a bearer authorization to your request
![A screenshot of a computer Description automatically generated with medium confidence](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-8-1024x614.pngw3.webp)
- Since access token expires after 1 hour, you need to refresh it using the refresh token. To do so, you can use the refresh_token you obtained in the previous “token” request:
- You’ll need to make a request to https://app.monitask.com/identity/connect/token
With the same basic auth but with the following body:
Grant_type=refresh_token
Redirect_uri is your redirect uri
Refresh_token is refresh token you received before
![Graphical user interface Description automatically generated](https://www.monitask.com/wp-content/w3-webp/uploads/2022/02/image-9.pngw3.webp)
When request is executed you will obtain new access and refresh tokens