Skip to content

Regex Search Product names

Daniel Cronqvist edited this page Dec 11, 2020 · 1 revision

Regex Search Product names - HTTP POST

Endpoint: https://co2.dcronqvist.se/products/search/name/regex

Example cURL POST:

$ curl -X POST -d '{ "search": "ovve" }' -H "Content-Type: application/json" 127.0.0.1:5000/products/search/name/regex

Expected payload format (EPF)

The following rules are applied to all keys in the payload using the EPF as a sample:

  1. Keys with arrays of specified types specify which types that are allowed for that specific key.
  2. Keys with specific values only allow that specific value in the payload.
  3. Keys that contain objects are recursively checked using rule 1 and 2.
{
    "search": ["str"],
}

Responses

200 OK

{
    "response": {
        "DTEK-D6OVVE-ALKIS": "Alkis D6 Ovve",
        "DTEK-DNOLLK-OVVE": "DNollK Ovve"
    },
    "status": "200 OK",
    "status_code": 200
}