General information #
Base url #
https://partner.hustlegotreal.com/api/productmonitor
Authentification #
All calls must include a header “token” with the public token provided.
Example
“token”: “UzeLodERPrLhyNPYfk/nFanUfwcP19sibK-h7ToAXbrcqE69G1”
Request and Responses #
In case of a method Post, body data must be send in json format.
Responses will always be JSON objects that will contain next format.
Field | Type | |
---|---|---|
status | string | Values: SUCCESS, ERROR |
error | Error Type | Only if status is ERROR |
result | Varies by endpoint | Only if status is SUCCESS |
Example #
{
"status":"ERROR",
"error":{
"code":"ERR_02",
"description":"Url empty or invalid"
}
}
Endpoints #
List #
Path | Method |
---|---|
/add | Post |
/remove | Post |
/list | Get |
/callcounter | Get |
/Add #
Method: Post
Adds a product to the list to be monitored.
Body request #
Field | Type | Notes |
---|---|---|
url | string | |
country | string | ISO 3166: US, ES, DE, IT… |
condition | number | (OPTIONAL) Condition Enum |
Example #
{
"url":"https://www.amazon.co.uk/dp/B005EJH6Z",
"country":"GB",
"condition": 0
}
Response result #
Result will be always empty.
/Remove #
Method: Post
Removes a product to the list to be monitored.
Body request #
Field | Type | Notes |
---|---|---|
url | string | |
country | string | ISO 3166: US, ES, DE, IT… |
condition | number | (OPTIONAL) Condition Enum |
Example #
{
"url":"https://www.amazon.co.uk/dp/B005EJH6Z",
"country":"GB",
"condition": 0
}
Response result #
Result will be always empty.
/List #
Method: Get
Get all current active products
No parameters or body is required.
Response result #
Field | Type | Notes |
---|---|---|
products | Array of Product type |
Example #
{
"products": [
{
"url": "https://www.amazon.co.uk/dp/B005EJH6Z",
"country": "GB",
"condition": 0
},
{
"name": "https://www.zavvi.es/14228657.html",
"country": "ES",
"condition": 3
}
]
}
/CallCounter #
Mehod: Get
Get the count of different products that have been monitorized this current month.
No parameters are needed
Response #
Field | Type | Notes |
---|---|---|
quantity | int |
Example #
{
"quantity":25
}
Webhooks #
Webhooks are requests that HGR will make to your endpoint. If you want to make sure that HGR is the one making this request, follow the steps below:
- Get the body from the request, apply Hmac SHA-256 using your Private Key
- Convert the result to base 64.
- With the request, you will receive a header called «X-HGR-Hmac-SHA256».
- The hash you have generated should match the hash in this header.
Only someone who knows your private key should be able to generate this hash, so only HGR and you could be the authors of this message as long as the key is not leaked.
Product Changed #
Method: Post
Everytime a product change is detected you your weebhook will be called. If options is empty, this product is out of stock.
Body request #
Field | Type | Notes |
---|---|---|
changes | Array of Change Type |
Example #
{
"changes":[
{
"url":"https://www.amazon.co.uk/dp/B005EJH6Z",
"country":"GB",
"condition": 2,
"options":[
{ "price":22.5, "shipping": 3, "prime": 1, "warehouse": "GB" },
{ "price":22.0, "shipping": 12, "prime": 0, "warehouse": "CN"}
]
},
{
"url":"https://www.amazon.es/dp/B0BGP7P6H9",
"country":"ES",
"condition": 0,
"options":[
{ "price":63.7, "shipping": 2, "prime": 1, "warehouse":null },
]
}
]
}
Response result #
You must response with a 200 status, otherwise system will try later to send again this information.
Types #
Error Type #
Field | Type | Notes |
---|---|---|
code | string | Values contained in Error List |
description | string |
Example #
{
"code":"ERR_05",
"description":"Unknown error"
}
Error List #
Code | Description |
---|---|
ERR_01 | Your Token is wrong |
ERR_02 | Url empty or invalid |
ERR_03 | Country wrong or invalid |
ERR_04 | Unable to obtain product information |
ERR_05 | Unknown error |
ERR_06 | Supplier or country not recognised. Try looking for this supplier in a different country |
ERR_07 | Wrong request key |
ERR_08 | Product information is not yet available |
ERR_09 | Product doesn’t exists |
Option Type #
Field | Type | Notes |
---|---|---|
price | number | |
shipping | number | Shipping time days |
prime | number | Prime Enum |
warehouse | string | Nullable, ISO 3166: CN, US, ES… |
Example #
{
"price":456.3,
"shipping": 3,
"prime": 0,
"warehouse":"CN"
}
Product Type #
Field | Type | Notes |
---|---|---|
url | string | |
country | string | ISO 3166: US, ES, DE, IT… |
condition | number | Condition Enum |
Example #
{
"name": "https://www.zavvi.es/14228657.html",
"country": "ES",
"condition": 1
}
Change Type #
Field | Type | Notes |
---|---|---|
url | string | |
country | string | ISO 3166: US, ES, DE, IT… |
condition | number | Condition Enum |
options | Option Type |
Example #
{
"url":"https://www.amazon.co.uk/dp/B005EJH6Z",
"country":"GB",
"condition": 2,
"options":[
{ "price":22.5, "shipping": 3, "prime": 1, "warehouse": null },
{ "price":22.0, "shipping": 12, "prime": 0, "warehouse": null }
]
}
Condition enum #
Meaning | Value (Amazon) |
---|---|
0 | New (default) |
1 | Like New |
2 | Very Good |
3 | Good |
4 | Acceptable |
Prime enum #
Meaning | Value (Amazon) |
---|---|
0 | Not Prime |
1 | Prime |