Skip to content

Latest commit

 

History

History
62 lines (50 loc) · 2.29 KB

TokensApi.md

File metadata and controls

62 lines (50 loc) · 2.29 KB

Tokens Methods

Method Description
TokensGetEphemeralToken Get Ephemeral Token

TokensGetEphemeralToken

TokensGetEphemeralTokenResponseBodyYaml TokensGetEphemeralToken (Redirect redirect = null, CancellationToken cancellationToken = default)

TokensGetEphemeralTokenResponseBodyYaml TokensGetEphemeralToken (HttpClient methodClient, Redirect redirect = null, CancellationToken cancellationToken = default)

Get Ephemeral Token

This endpoint returns a token that can be passed to an application for authorized access. The lifetime of this token is 10 seconds.

Example

using System.Collections.Generic;
using System.Diagnostics;
using ShipEngineSDK;
using ShipEngineSDK.Model;

namespace Example
{
    public class TokensGetEphemeralTokenExample
    {
        public static async Task Main()
        {
            var shipEngine = new ShipEngine("api_key");
            var redirect = (Redirect) "shipengine-dashboard";

            try
            {
                // Get Ephemeral Token
                TokensGetEphemeralTokenResponseBodyYaml result = await shipEngine.TokensGetEphemeralToken(redirect);
                Debug.WriteLine(result);
            }
            catch (ShipEngineException e)
            {
                Debug.Print("Exception when calling TokensApi.TokensGetEphemeralToken: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
methodClient HttpClient The HttpClient instance to use for the request.
redirect Redirect Include a redirect url to the application formatted with the ephemeral token. [optional]
cancellationToken CancellationToken The cancellation token to use for the request.

Return type

TokensGetEphemeralTokenResponseBodyYaml