Class: Peddler::API::Tokens20210301

Inherits:
Peddler::API show all
Defined in:
lib/peddler/api/tokens_2021_03_01.rb

Overview

Selling Partner API for Tokens

The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the Tokens API Use Case Guide.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #endpoint_uri, #http, #initialize, #meter, #must_sandbox!, #retriable, #sandbox, #sandbox?, #use, #via

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#create_restricted_data_token(body, rate_limit: 1.0) ⇒ Hash

Note:

This operation can make a static sandbox call.

Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations.

Parameters:

  • body (Hash)

    The restricted data token request details.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:

  • (Hash)

    The API response



32
33
34
35
36
# File 'lib/peddler/api/tokens_2021_03_01.rb', line 32

def create_restricted_data_token(body, rate_limit: 1.0)
  path = "/tokens/2021-03-01/restrictedDataToken"

  meter(rate_limit).post(path, body:)
end