Download the PHP package zero-to-prod/spapi-tokens-cli without Composer
On this page you can find all versions of the php package zero-to-prod/spapi-tokens-cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zero-to-prod/spapi-tokens-cli
More information about zero-to-prod/spapi-tokens-cli
Files in zero-to-prod/spapi-tokens-cli
Package spapi-tokens-cli
Short Description A CLI for getting a Restricted Data Token (RDT) for Amazon Selling Partner API (SPAPI).
License MIT
Homepage https://github.com/zero-to-prod/spapi-tokens-cli
Informations about the package spapi-tokens-cli
Zerotoprod\SpapiTokensCli
Contents
- Introduction
- Requirements
- Installation
- Documentation Publishing
- Automatic Documentation Publishing
- Usage
- Available Commands
spapi-tokens-cli:srcspapi-tokens-cli:rdtspapi-tokens-cli:rdt-from-tokenspapi-tokens-cli:rdt-from-scope
- Available Commands
- Docker Image
- Local Development
- Image Development
- Contributing
Introduction
A CLI for getting a Restricted Data Token (RDT) for Amazon Selling Partner API (SPAPI).
Requirements
- PHP 8.1 or higher.
Installation
Install Zerotoprod\SpapiTokensCli via Composer:
This will add the package to your project's dependencies and create an autoloader entry for it.
Documentation Publishing
You can publish this README to your local documentation directory.
This can be useful for providing documentation for AI agents.
This can be done using the included script:
Automatic Documentation Publishing
You can automatically publish documentation by adding the following to your composer.json:
Usage
Run this command to see the available commands:
Available Commands
spapi-tokens-cli:src
Displays the project's GitHub repository URL.
Usage:
Arguments: None
Example:
Output:
spapi-tokens-cli:rdt
Get a Restricted Data Token (RDT) for restricted resources using an existing access token.
Usage:
Arguments:
access_token(required): The access token to get a restricted resourcepath(required): The path in the restricted resourcedataElements(required): Comma separated list of data elements. Indicates the type of Personally Identifiable Information requestedtargetApplication(required): The application ID for the target application to which access is being delegated
Options:
--user_agent: User Agent (optional)--response: Returns the full response--expiresIn: The expiresIn value for the restrictedDataToken
Example:
Example Response (default - token only):
Example Response (with --response flag):
Example Response (with --expiresIn flag):
spapi-tokens-cli:rdt-from-token
Get a Restricted Data Token (RDT) for restricted resources from a refresh token. This command first exchanges the refresh token for an access token, then uses that access token to obtain the RDT.
Usage:
Arguments:
refresh_token(required): The LWA refresh tokenclient_id(required): Get this value when you register your applicationclient_secret(required): Get this value when you register your applicationpath(required): The path in the restricted resourcedataElements(required): Comma separated list of data elements. Indicates the type of Personally Identifiable Information requestedtargetApplication(required): The application ID for the target application to which access is being delegated
Options:
--user_agent: User Agent (optional)--response: Returns the full response--expiresIn: The expiresIn value for the restrictedDataToken
Example:
Example Response (default - token only):
Example Response (with --response flag):
Example Response (with --expiresIn flag):
Example Error Response (invalid credentials):
spapi-tokens-cli:rdt-from-scope
Get a Restricted Data Token (RDT) for restricted resources from a scope using client credentials. This command uses client credentials flow to obtain an access token, then uses that access token to obtain the RDT.
Usage:
Arguments:
scope(required): The LWA scope for the client credentials flowclient_id(required): Get this value when you register your applicationclient_secret(required): Get this value when you register your applicationpath(required): The path in the restricted resourcedataElements(required): Comma separated list of data elements. Indicates the type of Personally Identifiable Information requestedtargetApplication(required): The application ID for the target application to which access is being delegated
Options:
--user_agent: User Agent (optional)--response: Returns the full response--expiresIn: The expiresIn value for the restrictedDataToken
Example:
Example Response (default - token only):
Example Response (with --response flag):
Example Response (with --expiresIn flag):
Example Error Response (invalid scope):
Docker Image
You can also run the cli using the docker image:
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
All versions of spapi-tokens-cli with dependencies
ext-json Version *
symfony/console Version ^7.2
zero-to-prod/data-model Version ^81.9
zero-to-prod/spapi-tokens Version ^2.0
zero-to-prod/spapi-lwa Version ^4.0
zero-to-prod/package-helper Version ^1.1.3