Prerequisite: You should have Node.js (version 18.10.0 or higher) and an API token from the Pixio dashboard.
Step 1: Install the Pixio API SDK
To start interacting with the Pixio API, you need to install the Pixio SDK using npm or yarn:npm
Step 2: Configure API Key
Once the SDK is installed, create a.env
file in your project to securely store your Pixio API key.
npm
Step 3: Set up the Pixio API Client
Next, set up the Pixio API client in your code:npm
Step 4: Running a Workflow
You can trigger a workflow by making a POST request to the/run
endpoint with the deployment ID and input data:
npm
Step 5: Retrieve Workflow Output
After triggering the workflow, you can retrieve the output using therun_id
:
npm
Custom Ports
Pixio API calls are generally executed on standard ports. If you are working in a local development environment and need to customize the port for running your Node.js app:npm
Common Errors
If you encounter any errors such asEADDRINUSE
or other port-related issues, make sure that no other services are running on the same port.
npm
Pixio API Versions
To ensure compatibility with the latest Pixio API features, keep the SDK up-to-date:npm
Deployment
Once you’ve built your Pixio-powered application, you can deploy it on platforms like Vercel, Heroku, or AWS. For more details, check the Pixio API Documentation.
Troubleshooting
If you run into any issues while working with the Pixio API, here are a few troubleshooting steps:Invalid API Key
Invalid API Key
Ensure your
.env
file is correctly set up with your Pixio API key. Regenerate the API key if needed from the dashboard. Token Expired or Invalid
Token Expired or Invalid
Make sure your token is valid and hasn’t expired. You can renew it in the Pixio API dashboard under API Keys.
API Response Errors
API Response Errors
If you receive unexpected responses from the API, try resetting your environment and reinstalling dependencies by running
npm install
or yarn install
.