Skip to main content
POST
/
v1
/
search
/
mget
Multiple Get API
curl --request POST \
  --url 'https://api.askmiso.com/v1/search/mget?api_key=' \
  --header 'Content-Type: application/json' \
  --data '
{
  "product_ids": [
    "<string>"
  ],
  "engine_id": "<string>",
  "user_id": "<string>",
  "anonymous_id": "<string>",
  "user_hash": "<string>",
  "fl": [
    "*"
  ]
}
'
{
  "data": {
    "products": [
      {
        "product_id": "123ABC-S-Black"
      }
    ],
    "took": 0,
    "miso_id": "123e4567-e89b-12d3-a456-426614174000"
  },
  "message": "success"
}

Authorizations

api_key
string
query
required

Your secret API key is used to access every Miso API endpoint. You should secure this key and only use it on a backend server. Never leave this key in your client-side JavaScript code. If the private key is compromised, you can revoke it in Dojo and get a new one.

Specify your secret key in the api_key query parameter. For example:

POST /v1/users?api_key=039c501ac8dfcac91c6f05601cee876e1cc07e17

Body

application/json
product_ids
string[]
required

List of product_ids to retrieve. Products will be returned in the same order as they are given in this list.

engine_id
string

The engine you want to get results from. When you have more than one engine, you can use this parameter to specify the specific engine you want to get results from. If not specified, the default engine will be used.

user_id
string

The user who made the query and for whom Miso will personalize the results. For an anonymous visitor, use anonymous_id instead.

anonymous_id
string

The anonymous visitor who made the query and for whom Miso will personalize the results. Either user_id or anonymous_id needs to be specified for personalization to work.

user_hash
string

The hash of user_id (or anonymous_id) encrypted by your Secret API Key. user_hash is required to prevent unauthorized API access if you are making API calls with a Publishable API Key.

You should generate the user_hash via HMAC scheme: you encrypt the desired user_id (or anonymous_id) with your Secret API Key on your backend server, and then let the front-end code send the generated user_hash to Miso APIs to verify the identity of the API caller.

As long as the Secret API Key is kept secret, the user_hash prevents a malicious attacker from making unauthorized API calls or impersonating any of your users.

Miso APIs accept the case-incentive "hex digest" of user hash, a sample Python 3 code to generate it on your backend server is as follow:

import hashlib
import hmac

YOUR_MISO_SECRET_API_KEY = "039c501ac8dfcac91"
key_bytes = YOUR_MISO_SECRET_API_KEY.encode()
user_id = "USER_123" # or anonymous_id
user_id_bytes = user_id.encode()
user_hash = hmac.new(
key_bytes,
user_id_bytes,
hashlib.sha256).hexdigest()
# user_hash is "7eb04da5e..."

You can find more examples for other languages in this Github Gist

fl
string[]

List of fields to retrieve. For example, the following request retrieves only the title field of each product along with the product_id, which is always returned.

{"fl": ["title"]}

You can also match field names by using * as a wildcard. For example, the query below retrieves the title and any custom attributes under the attributes dictionary.

{"fl": ["title", "attributes.*"]}

The following retrieves all the available fields (which is the default):

{"fl": ["*"]}

For the lowest latency, use an empty array to retrieve just the product_id field.

{"fl": []}

Response

Successful Response

data
MultipleGetResponseBody · object
required

Return a list of Product records. Some or all of them are potentially not found

message
string
default:success