Skip to content

Latest commit

 

History

History
630 lines (467 loc) · 16.3 KB

TokensApi.md

File metadata and controls

630 lines (467 loc) · 16.3 KB

BasisTheory.net.Api.TokensApi

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

Method HTTP request Description
Create POST /tokens
Delete DELETE /tokens/{id}
Get GET /tokens
GetById GET /tokens/{id}
GetV2 GET /v2/tokens
Search POST /tokens/search
SearchV2 POST /v2/tokens/search
Update PATCH /tokens/{id}

Create

Token Create (CreateTokenRequest createTokenRequest)

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 TokensApi(config);
var createTokenRequest = new CreateTokenRequest()
{
    Id = ...
    Type = ...
    Data = ...
    Privacy = ...
    Metadata = ...
    SearchIndexes = ...
    FingerprintExpression = ...
    Mask = ...
    DeduplicateToken = ...
    ExpiresAt = ...
    Containers = ...
    TokenIntentId = ...
};

Token result = apiInstance.Create(createTokenRequest);

Using the CreateWithHttpInfo variant

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

try
{
    ApiResponse<Token> response = apiInstance.CreateWithHttpInfo(createTokenRequest);
    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 TokensApi.CreateWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
createTokenRequest CreateTokenRequest

Return type

Token

Authorization

ApiKey

HTTP request headers

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

HTTP response details

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

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

Delete

void Delete (string id)

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 TokensApi(config);
var id = "";

apiInstance.Delete(id);

Using the DeleteWithHttpInfo variant

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

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

Parameters

Name Type Description Notes
id string

Return type

void (empty response body)

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -

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

Get

TokenPaginatedList Get (List id = null, Dictionary<string, string> metadata = null, int? page = null, string start = null, int? size = null)

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 TokensApi(config);
var id = new List<string>();
var metadata = new Dictionary<string, string>()
var page = 1;
var start = "";
var size = 1;

TokenPaginatedList result = apiInstance.Get(id, metadata, page, start, size);

Using the GetWithHttpInfo variant

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

try
{
    ApiResponse<TokenPaginatedList> response = apiInstance.GetWithHttpInfo(id, metadata, page, start, size);
    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 TokensApi.GetWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id List<string> [optional]
metadata Dictionary<string, string> [optional]
page int? [optional]
start string [optional]
size int? [optional]

Return type

TokenPaginatedList

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
401 Unauthorized -
403 Forbidden -

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

GetById

Token GetById (string id)

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 TokensApi(config);
var id = "";

Token result = apiInstance.GetById(id);

Using the GetByIdWithHttpInfo variant

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

try
{
    ApiResponse<Token> response = apiInstance.GetByIdWithHttpInfo(id);
    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 TokensApi.GetByIdWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id string

Return type

Token

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
401 Unauthorized -
403 Forbidden -
404 Not Found -

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

GetV2

TokenCursorPaginatedList GetV2 (string start = null, int? size = null)

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 TokensApi(config);
var start = "";
var size = 1;

TokenCursorPaginatedList result = apiInstance.GetV2(start, size);

Using the GetV2WithHttpInfo variant

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

try
{
    ApiResponse<TokenCursorPaginatedList> response = apiInstance.GetV2WithHttpInfo(start, size);
    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 TokensApi.GetV2WithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
start string [optional]
size int? [optional]

Return type

TokenCursorPaginatedList

Authorization

ApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
401 Unauthorized -
403 Forbidden -

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

Search

TokenPaginatedList Search (SearchTokensRequest searchTokensRequest)

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 TokensApi(config);
var searchTokensRequest = new SearchTokensRequest()
{
    Query = ...
    Page = ...
    Start = ...
    Size = ...
};

TokenPaginatedList result = apiInstance.Search(searchTokensRequest);

Using the SearchWithHttpInfo variant

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

try
{
    ApiResponse<TokenPaginatedList> response = apiInstance.SearchWithHttpInfo(searchTokensRequest);
    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 TokensApi.SearchWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
searchTokensRequest SearchTokensRequest

Return type

TokenPaginatedList

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 -

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

SearchV2

TokenCursorPaginatedList SearchV2 (SearchTokensRequestV2 searchTokensRequestV2)

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 TokensApi(config);
var searchTokensRequestV2 = new SearchTokensRequestV2()
{
    Query = ...
    Start = ...
    Size = ...
};

TokenCursorPaginatedList result = apiInstance.SearchV2(searchTokensRequestV2);

Using the SearchV2WithHttpInfo variant

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

try
{
    ApiResponse<TokenCursorPaginatedList> response = apiInstance.SearchV2WithHttpInfo(searchTokensRequestV2);
    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 TokensApi.SearchV2WithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
searchTokensRequestV2 SearchTokensRequestV2

Return type

TokenCursorPaginatedList

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 -

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

Update

Token Update (string id, UpdateTokenRequest updateTokenRequest)

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 TokensApi(config);
var id = "";
var updateTokenRequest = new UpdateTokenRequest()
{
    Data = ...
    Privacy = ...
    Metadata = ...
    SearchIndexes = ...
    FingerprintExpression = ...
    Mask = ...
    ExpiresAt = ...
    DeduplicateToken = ...
    Containers = ...
};

Token result = apiInstance.Update(id, updateTokenRequest);

Using the UpdateWithHttpInfo variant

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

try
{
    ApiResponse<Token> response = apiInstance.UpdateWithHttpInfo(id, updateTokenRequest);
    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 TokensApi.UpdateWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id string
updateTokenRequest UpdateTokenRequest

Return type

Token

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/merge-patch+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]