PSMEDx Examples

Examples of how to use PSMEDx API

These pages will be published at PSMEDx Examples

Resources:

Easy of use

We are focussing here in how to use a Public Key that can be obtained from PSMEDx website once you have an account. With this Public Key you will be able to use the API without the need of a Secret Key that is used for authentication. Meaning you can access to GET requests that provide images based on query parameters.

In order for this public key to be secure, you need to add the allowed origin to your account. This is done in the Account section of the website.

Example 1: Get an image without the background

Basic example is this one:

<img src="https://api.psmedx.com/remove-background/?image_url=YOUR_IMAGE_URL&pub_api_key=YOUR_PUBLIC_KEY" />

Better Example

Example 2: Get decorated images based on an artwork(or logo)

Basic example is this one:

<img src="https://api.psmedx.com/decorate/?blank_url=YOUR_BLANK_URL&artwork_url=YOUR_ARTWORK_URL&pub_api_key=YOUR_PUBLIC_KEY&bounding_box_json=YOUR_BOUNDING_BOX" />

Ex. https://psmedx.com/decorate/?blank_url=https://s3.amazonaws.com/www.gallardo.solutions/products/Gildan Heavy Cotton Long Sleeve T-Shirt-ligth-blue.png&artwork_url=https://s3.amazonaws.com/www.gallardo.solutions/artworks/microsoft.png&bounding_box_json={"left":136,"upper":172,"right":282,"lower":300}&placement=Auto&emboss=false&pub_api_key=YOUR_PUBLIC_KEY


Better Example

But we provide a more complete examples using htmx and Alpine.js