For the complete documentation index, see llms.txt. This page is also available as Markdown.

FetchAccessToken

Frends Task for fetching access token for ServiceNow instance.

Task version: 1.1.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

Url : String

The base URL to the ServiceNow instance.

Default: - Example: https://dev123456.service-now.com

GrantType : GrantType

Grant type determines how the access token is fetched for ServiceNow.

Possible values:

  • Password: Password grant type enables to get an access token using user credentials.

  • Refresh_token: Refresh_token grant type enables to get an access token using alive refresh token.

  • Custom: Custom grant type enables you to create the urlencoded message with custom keys.

Default: - Example: Frends.ServiceNow.Definitions.GrantType.Password

ClientId : String

ServiceNow instance Client Id.

Default: - Example: 1ab23456c789ded785dhd

🗝ClientSecret : String

ServiceNow instance Client Secret.

Default: - Example: HBF78cfbe6?

Username : String

ServiceNow instance username.

Default: - Example: integration.user

🗝Password : String

ServiceNow instance password.

Default: - Example: cvj#renivreb7tycv4e8!cv7reb8v47382?

🗝RefreshToken : String

RefreshToken for ServiceNow instance. You can get the refresh token when initially fetched the access token with password grant type.

Default: - Example: 5FDughf_ncuenUJbvcerubn67cbe-fjncer8c7efcbE88fcvbvc48vbncsifb_kbncUgbE9FCVBE

Properties : CustomProperty[]

Array of custome properties for the url encoded message.

Default: - Example: [ { Name: CustomName, Value: CustomValue } ]

Name
Description

ConnectionTimeoutSeconds : Int32

Timeout in seconds to be used for the connection and operation.

Default: 30 Example: 30

FollowRedirects : Boolean

If FollowRedirects is set to false, all responses with an HTTP status code from 300 to 399 is returned to the application.

Default: True Example: true

AllowInvalidCertificate : Boolean

Do not throw an exception on certificate error.

Default: - Example: true

AllowInvalidResponseContentTypeCharSet : Boolean

Some Api's return faulty content-type charset header. This setting overrides the returned charset.

Default: - Example: true

ThrowExceptionOnErrorResponse : Boolean

Throw exception if return code of request is not successfull.

Default: - Example: true

AutomaticCookieHandling : Boolean

If set to false, cookies must be handled manually. Defaults to true.

Default: True Example: true

Task Result

Name
Description

Body : Object

Contains the access token to a certain ServiceNow instance. Example: { "access_token": "6mq79vy2XwgVp-vnrijbn7_JKfnbiebfjnube788743fYEiNltfjeOBbDTpMru664esGGvhJJxh2uJJ4EkDnKAkaA", "refresh_token": "9zXaz_7cfbe7fbcvF76bvce72aAHylz-IKJDb7fhbee7bfe74Pwh77vv0tz815ptH_eFHr8zXzVA", "scope": "useraccount", "token_type": "Bearer", "expires_in": 1799 }

StatusCode : Int32

Statuscode of response Example: 200

Task Changelog

Changelog for Task Frends.ServiceNow.FetchAccessToken.

[1.1.0] - 2025-03-18

Changed

  • Update packages: Newtonsoft.Json 12.0.3 -> 13.0.3 System.ComponentModel.Annotations 4.7.0 -> 5.0.0 System.Runtime.Caching 7.0.0 -> 9.0.3 coverlet.collector 3.1.2 -> 6.0.4 Microsoft.NET.Test.Sdk 16.6.1 -> 17.13.0 nunit 3.12.0 -> 4.3.2 NUnit3TestAdapter 3.17.0 -> 5.0.0

[1.0.0] - 2023-10-17

Changed

  • Initial implementation

Last updated

Was this helpful?