Skip to content

Latest commit

 

History

History
151 lines (110 loc) · 3.85 KB

SessionsApi.md

File metadata and controls

151 lines (110 loc) · 3.85 KB

BasisTheory.net.Api.SessionsApi

All URIs are relative to https://api.basistheory.com

Method HTTP request Description
Authorize POST /sessions/authorize
Create POST /sessions

Authorize

void Authorize (AuthorizeSessionRequest authorizeSessionRequest)

Example

using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var apiInstance = new SessionsApi(config);
var authorizeSessionRequest = new AuthorizeSessionRequest()
{
    Nonce = ...
    ExpiresAt = ...
    Permissions = ...
    Rules = ...
};

apiInstance.Authorize(authorizeSessionRequest);

Using the AuthorizeWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    apiInstance.AuthorizeWithHttpInfo(authorizeSessionRequest);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling SessionsApi.AuthorizeWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
authorizeSessionRequest AuthorizeSessionRequest

Return type

void (empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
409 Conflict -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Create

CreateSessionResponse Create ()

Example

using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var apiInstance = new SessionsApi(config);

CreateSessionResponse result = apiInstance.Create();

Using the CreateWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    ApiResponse<CreateSessionResponse> response = apiInstance.CreateWithHttpInfo();
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling SessionsApi.CreateWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

CreateSessionResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -

[Back to top] [Back to API list] [Back to Model list] [Back to README]