dotConnect for FreshBooks Documentation
Devart.Data.FreshBooks Namespace / FreshBooksConnectionStringBuilder Class / AccessToken Property

In This Topic
    AccessToken Property
    In This Topic
    Gets or sets the OAuth access token for FreshBooks. This parameter is used for connecting via Alpha API. Note that this token expires after 12 hours and is refreshed automatically, using RefreshToken.
    Syntax
    'Declaration
     
    Public Property AccessToken As String
    public string AccessToken {get; set;}

    Property Value

    The OAuth access token for FreshBooks.
    Remarks

    You may specify the RefreshToken and AccessToken parameters in the connection string or create a file with tokens yourself, specify the path to it in the OAuthStorage parameter, and omit the token parameters in the connection string. The file must be a two-line text file with AccessToken on the first line and RefreshToken on the second line.

    Whenever AccessToken needs to be regenerated (it expires after 12 hours since retrieving), dotConnect for FreshBooks automatically updates this file or creates such file by the path specified if it doesn't exist. This is done because RefreshToken is used to retrieve a new AccessToken, but it is reset too during the refresh process. Thus, you cannot use the same tokens for the connection. dotConnect for FreshBooks manages these tokens automatically, and sets them to the new values when necessary. And it uses the file specified in the OAuthStorage property to store the current tokens in order to load and use them when the application is closed and then started again so that you don't need to re-authenticate and retrieve new tokens every time when the application starts.

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also