NAV
shell

Introduction

Welcome to the Superpictor API! The Basics Superpictor API is organized around REST.

Our API accepts JSON request bodies, returns JSON responses, and uses standard HTTP response codes.

After authentication, it allows you to list the missions, to get a specific mission and to order a mission.

Authentication

Generate JWT token

JSON request:

{
    "email":"exemple@gmail.com",
    "apiKey":"99bf1b36-f940-11ec-adc9-1da6a7091e35"
}

JSON response:

{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}

The Superpictor API requires authentication and uses an access token system. This allows you to protect the URLs on your web server so that only you can access them. In order to authenticate with HTTP, you may provide an email and api key in the body of the following endpoint :

POST http://api.superpictor.com/api/v3/api_key_check

If credentials are valid, you’ll get a jwt token which will be used in headers of each endpoint.

This token is valid for one hour.

Missions

Get all missions

curl "http://api.superpictor.com/api/v3/order/list" \
  -H "Authorization: Bearer __token__"

The above command returns JSON structured like this:

[
    {
        "order_number": "af87061965",
        "order_status": "Confirmed",
        "order_item_name": "Vectoriser",
        "product_item_price": 16,
        "created_on": "2022-06-13 13:00:57",
        "fileUrl": [
            {
                "file_url": "finishedfiles/62454/5_62ab4094ce4dc_af87061965.ai",
                "extension": "ai",
                "version": "2"
            },
            {
                "file_url": "finishedfiles/62454/3_62ab4093b6cb1_af87061965.pdf",
                "extension": "pdf",
                "version": "2"
            },
            {
                "file_url": "finishedfiles/62454/4_62ab4094009cc_af87061965.png",
                "extension": "png",
                "version": "2"
            },
            {
                "file_url": "finishedfiles/62454/2_62a803639e45a_af87061965.ai",
                "extension": "ai",
                "version": "1"
            },
            {
                "file_url": "finishedfiles/62454/0_62a80362a19b1_af87061965.pdf",
                "extension": "pdf",
                "version": "1"
            },
            {
                "file_url": "finishedfiles/62454/1_62a80362df605_af87061965.png",
                "extension": "png",
                "version": "1"
            }
        ]
    },
    {
       
    },
    {
        
    }
]

You can get all your missions with this endpoint.

You can add params to paginate and to order the response.

HTTP Request

GET http://api.superpictor.com/api/v3/order/list

HTTP Headers

Authorization: Bearer Token

Query Parameters

Parameter Default Description
page 1 page number
limit 20 number of items per page
order desc order of items by creation date

Get a specific mission

curl "http://api.superpictor.com/api/v3/order/get/<order_number>" \
  -H "Authorization: Bearer  __token__"

The above command returns JSON structured like this:

{
    "order_number": "af87061965",
    "order_status": "Confirmed",
    "order_item_name": "Vectoriser",
    "product_item_price": 16,
    "created_on": "2022-06-13 13:00:57",
    "fileUrl": [
        {
            "file_url": "finishedfiles/62454/5_62ab4094ce4dc_af87061965.ai",
            "extension": "ai",
            "version": "2"
        },
        {
            "file_url": "finishedfiles/62454/3_62ab4093b6cb1_af87061965.pdf",
            "extension": "pdf",
            "version": "2"
        },
        {
            "file_url": "finishedfiles/62454/4_62ab4094009cc_af87061965.png",
            "extension": "png",
            "version": "2"
        },
        {
            "file_url": "finishedfiles/62454/2_62a803639e45a_af87061965.ai",
            "extension": "ai",
            "version": "1"
        },
        {
            "file_url": "finishedfiles/62454/0_62a80362a19b1_af87061965.pdf",
            "extension": "pdf",
            "version": "1"
        },
        {
            "file_url": "finishedfiles/62454/1_62a80362df605_af87061965.png",
            "extension": "png",
            "version": "1"
        }
    ]
}

This endpoint retrieves a specific mission.

HTTP Request

GET http://api.superpictor.com/api/v3/order/get/<order_number>

HTTP Headers

Authorization: Bearer Token

URL Parameters

Parameter Description
order_number You can find it in the list of missions

Create mission

Body request:

file : 
  Content-Disposition: form-data; name="file"; filename="image.png"
  Content-Type: image/png, image/jpeg
product_id : integer //check in products IDs table
params :
{
    "comment" : "string",
    "width" : integer, //in mm
    "height" : integer, //in mm
    "emb_support" : "Nom du support à broder",
    "gradient" : "false", //true or false
    "num_color" : "", // nbe de couleurs
    "out_format" : "code", //check codes in out formats table
    "special_size" : "",
    "thread" : "code" //check codes in threads table
}

You can order a basic to this endpoint.

Request description

The file must be uploaded using a multipart request.

In the product_id field, put the product Id reffering you to the Product IDs table.

In the params field, send a JSON.

HTTP Request

POST http://api.superpictor.com/api/v3/order/create

HTTP Headers

Authorization: Bearer Token

Products IDs

ID Description
1 Vectoriser
2 Programme de broderie
3 Détourer
4 re-Designer
14 Cut-contours
15 Programmes de surnoms
19 Planche transfert sérigraphique

Out formats

Format Code
Tajima (.dst) tajima_dst
Barudan (.U01) barudan_u01
ZSK (.DSZ) zsk_dsz
Brother (.PES) brother_pes
Elna (.SEW) elna_sew
Bernina (.EXP) bernina_exp
.CSD csd
.JEF jef
.EXP exp
.HUS hus
.XXX xxx
Wilcom e2 (.EMB) wilcom_e2_emb
Wilcom e3 (.EMB) wilcom_e3_emb
Wilcom e4 (.EMB0) wilcom_e4_emb
Tajima Pulse (.PXF) tajima_pulse_pxf
Tajima Pulse 13 (.PXF) tajima_pulse_13_pxf
Drawings/WINGS (.NGS) wings_ngs
Illustrator (.ai) illustrator_ai
Vectoriel (.eps) vectoriel_eps
Acrobat (.pdf) acrobat_pdf
Corel (.cdr) corel_cdr
DXF (.dxf) dxf
Happy (.TAP) happy_tap

Threads

Thread Code
Isacord 40 isacord40
Gunold gunold
Madeira Polyneon madeira_poly
Madeira Classic 40 madeira_classic

Errors

Code Meaning
100 Bad entry -- At least one parameter is missing.
101 Bad entry -- At least one mission parameter is missing.
102 Bad entry -- At least one mission parameter is invalid.
400 Bad Request -- Your request is invalid.
401 Umauthorized -- Your token is wrong or expired.
404 Not Found -- The specified mission could not be found.
405 Method Not Allowed -- You tried to access a mission with an invalid method.
500 Internal Server Error -- We had a problem with our server.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.