Get an Access Token

Get a specific Access Token by ID. Note that the returned Access Token will include other metadata but will not include the serialized token string, and therefore cannot be used to authenticate SDK requests. The serialized token string is only available when you first create a new Access Token. As a security measure, only a hash of the serialized token is stored.

👍

Permissions Required

You can only get metadata for Access Tokens that you created, unless you are a team administrator. Team admins can get metadata for all Access Tokens on your Catalytic team.

Method Signature

AccessToken Get(Guid id);
async Task<AccessToken> GetAsync(Guid id);

Parameters

ParameterTypeDescription
idGuidThe id of the Access Token to get
returnsAccessTokenThe requested Access Token
AccessToken Get(string id);
async Task<AccessToken> GetAsync(string id);
ParameterTypeDescription
idstringThe id of the Access Token to get
returnsAccessTokenThe requested Access Token

TESTING SECTION

Method Signatures

Option 1

AccessToken Get(Guid id);
async Task<AccessToken> GetAsync(Guid id);
ParameterTypeDescription
idGuidThe id of the Access Token to get
returnsAccessTokenThe requested Access Token

Option #2

AccessToken Get(string id);
async Task<AccessToken> GetAsync(string id);
ParameterTypeDescription
idstringThe id of the Access Token to get
returnsAccessTokenThe requested Access Token

Example

/*
 * This example demonstrates getting an Access Token by ID
 */
using Catalytic.Sdk.Entities;

namespace Catalytic.Sdk.Examples
{
    class Program
    {
        static void Main(string[] args)
        {
            var catalytic = new Catalytic.Sdk.CatalyticClient(AccessToken.Default);
            var metaDataOnly = catalytic.AccessTokens.Get(AccessToken.Default.Id);
            // metaDataOnly will be the same as AccessToken.Default except the
            // serialized `Token` property will be null
        }
    }
}