Documentation

API Device : Services USB/Impressions

NOUVELLE VERSION V2 : CLIQUEZ-ICI

Vous êtes développeur ou une agence web ? Inscrivez-vous au programme Expedy Partner

Requête permettant de gérer les périphériques USB (imprimantes) et ordres d’impressions.

URL requête : http://www.expedy.fr/api/device/usb/nom_du_service

ServicesExemples requêteExemples réponse
/device/usb/conf$service_url = “https://www.expedy.fr/api/device/usb/conf”; 3 arguments : sid, token, rpi_uid $data_request = array(
‘sid’ => $api_sid,
‘token’ => $api_token,
‘rpi_uid’ => $rpi_uid
); et retourne “last_ping”, ainsi que “usb_conf” , la dernière configuration usb enregistrée complète au format json
{
“status”:”ok”,
“last_ping”:”1641511426″,
“usb_conf”:[
{“usb_port”:”1″,”usb_status”:”1″,
“device_manufacturer”:”Datamax-O`Neil”,
“device_model”:”Datamax-O’Neil E-Class MarkIII”},
{“usb_port”:”2″,”usb_status”:”0″},
{“usb_port”:”3″,”usb_status”:”1″,
“device_manufacturer”:”Caysn”,
“device_model”:”Thermal Printer”,
“device_width”:”80″},
{“usb_port”:”4″,”usb_status”:”0″}
]
}
/device/usb/scan$service_url = “https://www.expedy.fr/api/device/usb/scan”; 3 arguments : sid, token, rpi_uid $data_request = array(
‘sid’ => $api_sid,
‘token’ => $api_token,
‘rpi_uid’ => $rpi_uid
); et retourne “last_ping”
{“status”:”ok”,”last_ping”:”1641509604″}
/device/usb/read$service_url = “https://www.expedy.fr/api/device/usb/scan”; 3 arguments : sid, token, rpi_uid $data_request = array(
‘sid’ => $api_sid,
‘token’ => $api_token,
‘rpi_uid’ => $rpi_uid
); et retourne “last_ping”
{“status”:”ok”,”last_ping”:”1641509604″}
/device/usb/read$service_url = “https://www.expedy.fr/api/device/usb/scan/read”; 3 arguments : sid, token, rpi_uid $data_request = array(
‘sid’ => $api_sid,
‘token’ => $api_token,
‘rpi_uid’ => $rpi_uid
); et retourne “last_ping”, ainsi que “usb_conf” , la dernière configuration usb scannée précédemment, au format json
{
“status”:”ok”,
“last_ping”:”1641511582″,
“usb_scan”:[
{“usb_port”:”1″,”usb_status”:”1″,
“device_manufacturer”:”Datamax-O`Neil”,
“device_model”:”Datamax-O’Neil E-Class MarkIII”,
“device_status”:”ready”},
{“usb_port”:”2″,”usb_status”:”0″},
{“usb_port”:”3″,”usb_status”:”1″,
“device_manufacturer”:”Caysn”,
“device_model”:”Thermal Printer”,
“device_status”:”ready”,
“device_width”:”80″},
{“usb_port”:”4″,”usb_status”:”0″}
]
}
/device/usb/print$service_url = “https://www.expedy.fr/api/device/usb/print”; 5 arguments, + un argument optionel : sid, token, rpi_uid, usb_port, usb_msg, notification_url (optionel) $data_request = array(
‘sid’ => $api_sid,
‘token’ => $api_token,
‘rpi_uid’ => $rpi_uid,
‘usb_port’ => ‘3’,
‘usb_msg’ => ‘mon message a imprimer ou url du pdf ou document a imprimer’,
‘notification_url’ => ‘https://www.mondomaine.tld/mon_script_de_callback/…’
); et retourne “last_ping”, et “request_uid”, l’id unique de cette tâche d’impression
{“status”:”ok”,”last_ping”:”1641509604″,
“request_uid”:”1X5ERXL94BYVWHP92DK3MCASUGJ”}