Quicktask API

Quicktask API

This detailed documentation can be submitted to your group to implement MangoAIO Quick Tasks.


Link Creation

The QuickTask System uses RSA encrypted JSON objects. The public key for the encryption can be found here:

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmJDg97hR4aphMxzRtDO6
ZnI1B5TCzZmaakRrqljwKvSH9bc8qR6m8bBpyEwQ1jq0Amb0RdPclKoCwa5155+m
ZJfOP7uVzZrCWIv3ezQNW70mEoaxdfNw3nPRKrvwtLmNDAWYuye2lfUg4wOgquzE
AMnrPZKPlvyOJWHi04zjvQIZFm60Ohg+rSEFHcyNksWlFv/K1LTDaS+Ug+7EfMNu
+F0roBVnpnzXrlq4L4i1QUAgR3gI1K8tiQAXXKBK44nQEYGdWRqwGXRraniWrgxk
vp6kl+dWl8hb9NknNkaEeiQk1BvJtMjZlM3pUNu4zANIyVx8DY0qTOSDn3t6yBNg
WQIDAQAB
-----END PUBLIC KEY-----

JSON Format:

site: Unique formatted site name (e.g. outback, einhalb, will be provided on demand) or auto which lets our API parse the correct site

input: The input for the tasks. (Please don’t url encode this value)

quantity (optional) : Overwrite the amount of tasks

region (optional): Only needed for ASOS.

Example:

{ "site": "snipes", "input": "123456789", "quantity": "1", "region": "DE"}

Link Format:

The encrypted JSON payload needs to be passed as a query string. Remember to url encode the encrypted string.

Example:

https://qt.mangoaio.com?encrypted=PAYLOAD

Example Implementations

JS:

const { publicEncrypt } = require("crypto");

const PUBLIC_KEY = `INSERT PUBLIC KEY HERE`;

function createLink(data) {
    let encrypted = publicEncrypt(PUBLIC_KEY, Buffer.from(JSON.stringify(data))).toString("base64");
    let link = "https://qt.mangoaio.com?encrypted=" + encodeURIComponent(encrypted);
    return link;
}

console.log(createLink({ site: "snipes", input: "123456789", quantity: "1", region: "DE" }))

Python:

import base64
import json
import urllib.parse

from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA

PUBLIC_KEY = """INSERT PUBLIC KEY HERE"""

def create_link(data):
    key = RSA.import_key(PUBLIC_KEY)
    cipher = PKCS1_OAEP.new(key)
    encrypted = base64.b64encode(cipher.encrypt(json.dumps(data).encode())).decode()
    link = "https://qt.mangoaio.com?encrypted=" + urllib.parse.quote(encrypted)
    return link


print(create_link({ "site": "snipes", "input": "123456789", "quantity": "1", "region": "DE" }))

Remember to install the cryptography module:

pip install cryptography

Sitename format aboutyou asos bol bstn einhalb engelhorn footpatrolfe, footpatrolbe footshop jdsportsfe, jdsportsbe kickz louisvuitton mediamarkt naked onygo opiumparis otto outback overkill saturn sizefe,sizebe sizeer snipes sns solebox stress suppa susi svd swatch teamsports topps woodwood yme

input requirements

11TeamSports (URL) 43einhalb (URL) AboutYou (PID) ASOS (PID) BSTN (URL) Bol (URL) Engelhorn (URL) Footpatrol (PID) Footshop (URL) JD Sports (PID) Kickz (URL/PID) Louis Vuitton (URL/PID) MediaMarkt (URL/PID) MyTheresa (URL) NakedCPH (URL) Onygo (PID) OpiumParis (URL) Otto (URL) Outback Sylt (URL) Overkill (URL) SNS (URL) SVD (URL) Saturn (URL/PID) Size? (PID) Sizeer (URL) Snipes (PID) Solebox (PID) Stress95 (URL) Suppa Store (URL) Susi IT (URL) Swatch (URL) Topps (URL/PID) WoodWood (URL) YME Universe (URL)

Last updated