Pixlr provides an API to empower third-party developers to integrate Pixlr's robust editing capabilities into their own applications, fostering a dynamic ecosystem of creative tools and solutions.
A JWT token is used to authenticate and authorize the client to use the Pixlr API.
The token gets passed to the Pixlr Applications using the 'token' query parameter on any of the Application pages.
(ex: https://pixlr.com/editor/?token=eyJhbGc...gYAUKKg).
The JWT is signed using your Pixlr API secret. Using any of these algorithms:
RS256, RS384, RS512, PS256, PS384, PS512, ES256, ES256K, ES384, ES512, EdDSA, HS256, HS384, HS512
JWT tokens should only be generated on the server-side to avoid leaking credentials!
These are the properties and values that goes directly into the JWT payload.
Property | Type | Required | Description |
---|---|---|---|
sub | string | yes | JWT subject, use your Pixlr API key in the sub field |
mode | http embedded | yes | Which API mode you are operating in |
origin | string | yes - in embedded mode |
Specifiy the name of your application (ex: https://yourdomain.com). This should be the base domain from where you will use the API. We do this to make sure the Pixlr Applications only responds to messages coming from the right place. |
openUrl | string | yes - in http mode | In http mode, specify a URL where the Pixlr Application will fetch and open an image on startup. |
saveUrl | string | yes - in http mode | In http mode, specify where the Pixlr Applications will send a HTTP POST with the saved image. |
follow | boolean | no |
If this is enabled the Application window will POST to the saveUrl
using a standard FORM, so the entire window will navigate to the saveUrl location. If this is disabled the Application will POST using XHR so that the Application window remains intact. follow defaults to true |
settings | Settings | no | Settings to apply to Pixlr Applications |
Settings are used to change the behaviour, theme of the Pixlr Applications.
These are only in app settings and does not alter the behaviour of the API.
These settings can also be configured on a per api key basis under the Developer tab in My Account.
Settings added to the token will override any pre-configured value.
This enables you to have a pre-configured set of base settings and with the ability to override as needed.
Property | Type | Description |
---|---|---|
referrer | string | Name of the Application using the API, this is shown in the Pixlr Applications |
icon | string | URL to an icon for your Application that is shown in the Pixlr Applications |
accent | string | Accent color |
workspace | string | Workspace color (background color) |
tabLimit | number | The maximum number of tabs a user can have open at once |
blockOpen | boolean | Weather the Pixlr Application should block users from opening images from other sources than the API |