Skip to content
Mint Service Desk Documentation centre

Api

Mint Service Desk 3.4.2 user manual.

Api

View, create, edit and delete API clients for Mint Service Desk.

To create a new API client, click on the button located on the right side, next to the search field. You will be moved to the ‘API’ view where you need to fill some necessary data.

Enter the following required information:

  • ‘Client id’ – API Client identifier,
  • ‘Client name’ – API Client name.

Choose the client’s ‘Allowed scopes’. These determine which endpoints it can access.

In the Mint Service Desk, you have three available scopes to choose from:

  • ‘mint_api.assets’ – gives access to edition and viewing the MINT Service Desk assets
  • ‘mint_api.tickets’ – gives a possibility to view information about tickets, add comments and make other changes
  • ‘mint_api.user_restricted (Require user)’ – adds additional possibilities to the scopes mentioned above. It unblocks, among others, creating tickets and adding new articles

If you select ‘mint api.assets’ and/or ‘mint api tickets’ you will be able to save the new API Client. To do so just click the button.

Related articles

Creating A Request

Creating the API client

To create a query you first need to prepare a client. To do this, press button.

The client authenticates machine-to-machine requests using client_id and client_secret.

  • Client id (Remember not to use spaces between words but use e.g.‘_’)
  • Client name
  • Allowed scopes (We will focus on two scopes: mint.api_assets and mint_api.tickets)

Scopes determine which API operations the generated token can access.

After adding the scopes and pressing button, a Client secret is generated which needs to be copied and saved. Remember that when the secret is generated again, the secret will no longer be valid.

Obtaining a token

To obtain a token in Postman, create a request using POST. Enter your Mint address followed by ‘/connect/token’, for example https://rcmintsd.opgksoftware.com/connect/token.

Now you need to configure four fields:

  • grant_type: enter client_credentials.
  • client_id: enter the client_id used in the API configuration.
  • client_secret: enter the secret generated for the API client.
  • scope: enter the scopes assigned to the API client.

Remember to do this in ‘x-www-form-urlencoded’.

Now press the ‘Send’ button to receive the token.

Testing a request

Copy the token received and you can test it on your_address_to_mint/swagger/index.html

To start testing first press button. In the field that appears, type ‘Bearer your_token’

Then press button again.

Now you can test if the token works. Go below to the ‘Tickets’ section and select ‘/api/Tickets/{ticketId}’. You will see the example that will be returned after testing. Press button. Fill in the ‘ticketid’ field by typing the id of the ticket you want to preview. Then press Execute button.

You don’t have to test it on swagger. You can do the same in Postman by selecting the GET method and typing ‘page_address/api/Tickets/{ticketId}’ Example: https://rcmintsd.opgksoftware.com/api/Tickets/{ticketId}.

Creating A Bot User

Scope and bot account

While creating an API Client you can select the third ‘Allowed scope’: ‘mint_api.user_restricted (Require user)’ from the list of available scopes.

This scope requires a Bot user. Requests that need a user are sent on behalf of that account.

Selecting the scope opens the ‘Create bot user’ section.

Now, you need to type ‘Email’ (the correct email address), ‘First name’ and ‘Surname’. Once you finish, click on the button. You will see an additional window ‘One-time secret’.

Saving the secret

By default, the ‘Secret’ is hidden. To see its content, you need to click on the icon. Now write down, remember, or copy the ‘Secret’. You also can click the icon to copy the secret to your clipboard and paste it e.g., to some text editor.

The secret is the key used by the calling web service.

Once you saved this secret just click button and API Client (with Bot user) will be created.

Managing the API client

After creating a new API Client, you can always either change anything inside it ( button) or even delete it from the system ( button).

When editing an API client, use the ‘Secrets’ section on the right to view its registered secrets.

Here, you can generate a new secret. Simply click the button and copy/write down/memorize the secret just like you did when you were creating a Bot user.

You can also delete any of them by moving the mouse cursor over one desired position. A new button will appear. Just click on it and the secret will be deleted.