API Routes ========== Genesys attachments ------------------- For upload attachment to Genesys, you must send http request to windy backend. Request ~~~~~~~ - method: POST - url: https://${windy-backend-hostname}/api/upload - Headers: "Content-Type: multipart/form-data" - Body: - user=${jid}:${msisdn} - attachment=${attachmentFile} where: - **${jid}** must be the user *Jid* of XMPP - **${msisdn}** must be the *MSISDN* - **${attachmentFile}** attachment with accepted extension type `jpg`, `png`, `gif`, `tif`, `doc`, `docx`, `pdf`, `mp3`, `zip`, `rar` Responses ~~~~~~~~~ Success Response ................ - status: 201 - body: .. code-block:: json { "url": "http://..." } Error Responses ............... Response will be like body response: .. code-block:: typescript { code: number description: string } The table above describe response of error cases, where `code` and HTTP status code must be: +------+----------------------------------------------------------------------------------------+-------------+ | code | description | http status | +======+========================================================================================+=============+ | 1 | No attachment on request | 400 | +------+----------------------------------------------------------------------------------------+-------------+ | 2 | Wrong attachment extension: allowed extension jpg|png|gif|tif|doc|docx|pdf|mp3|zip|rar | 400 | +------+----------------------------------------------------------------------------------------+-------------+ | 3 | Attachment size exceed allowed limit | 400 | +------+----------------------------------------------------------------------------------------+-------------+ | 99 | Genesys generic error | 500 | +------+----------------------------------------------------------------------------------------+-------------+ | -1 | Unrecognized Genesys error | 500 | +------+----------------------------------------------------------------------------------------+-------------+ | 1000 | Generic upload error | 500 | +------+----------------------------------------------------------------------------------------+-------------+ | 1001 | Validation error: No attachment on request | 400 | +------+----------------------------------------------------------------------------------------+-------------+ | 1002 | Validation error: Attachment file extension not allowed | 400 | +------+----------------------------------------------------------------------------------------+-------------+ | 1003 | Validation error: Attachment file size exceed allowed limit | 400 | +------+----------------------------------------------------------------------------------------+-------------+ | 1100 | Generic database error | 500 | +------+----------------------------------------------------------------------------------------+-------------+ | 1101 | Conversation of required jid & msisd was not found | 400 | +------+----------------------------------------------------------------------------------------+-------------+ and `description` is the error description