MultipleGetRequest
- productType: array string[] · Product Ids
_ids requiredList of product_ids to retrieve. Products will be returned in the same order as they are given in this list.
- anonymousType: string · Anonymous Id
_id The anonymous visitor who made the query and for whom Miso will personalize the results. Either
user_idoranonymous_idneeds to be specified for personalization to work. - engineType: string · Engine Id
_id 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.
- flType: array string[] · Fl
List of fields to retrieve. For example, the following request retrieves only the
titlefield of each product along with theproduct_id, which is always returned.{"fl": ["title"]}You can also match field names by using
*as a wildcard. For example, the query below retrieves thetitleand any custom attributes under theattributesdictionary.{"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_idfield.{"fl": []} - userType: string · User Hash
_hash The hash of
user_id(oranonymous_id) encrypted by your Secret API Key.user_hashis 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
- userType: string · User Id
_id The user who made the query and for whom Miso will personalize the results. For an anonymous visitor, use
anonymous_idinstead.
