I want to test the these endpoints from the docs using my api key but I always get this
{
“result”: “error”,
“error”: “Unauthorized request.”,
“code”: “ER_UNAUTHORIZED”
}
I did everything right. Can someone help me?
I want to test the these endpoints from the docs using my api key but I always get this
{
“result”: “error”,
“error”: “Unauthorized request.”,
“code”: “ER_UNAUTHORIZED”
}
I did everything right. Can someone help me?
Hello, can you show exact CURL commands that give you this error? Here’s a sample, note that dhv743unoc.execute-api.eu-central-1.amazonaws.com can be replaced with network.ruuvi.com:
curl --location 'https://dhv743unoc.execute-api.eu-central-1.amazonaws.com/register' \
--header 'Content-Type: application/json' \
--data-raw '{"email":"otso@ruuvi.com"}'
{
"result": "success",
"data": {
"email": "otso@ruuvi.com"
}
}
curl --location 'https://dhv743unoc.execute-api.eu-central-1.amazonaws.com//verify?token=JWM6'
{
"result": "success",
"data": {
"email": "otso@ruuvi.com",
"accessToken": "753135/4sXXXXq",
"newUser": false
}
}
curl --location 'https://dhv743unoc.execute-api.eu-central-1.amazonaws.com/subscription' \
--header 'Authorization: Bearer 753135/4sXXXXq'
{
"result": "success",
"data": {
"subscriptions": [
{
"subscriptionName": "Business Starter",
"maxClaims": 40,
"maxShares": 80,
"maxSharesPerSensor": 20,
"maxHistoryDays": 1096,
"maxResolutionMinutes": 1,
"isActive": true,
"startTime": 1690797997,
"endTime": 1722333997
},
{
"subscriptionName": "Pro",
"maxClaims": 25,
"maxShares": 40,
"maxSharesPerSensor": 10,
"maxHistoryDays": 731,
"maxResolutionMinutes": 1,
"isActive": false,
"startTime": 1688633497,
"endTime": 1720169497
},
{
"subscriptionName": "DEV",
"maxClaims": 25,
"maxShares": 40,
"maxSharesPerSensor": 5,
"maxHistoryDays": 720,
"maxResolutionMinutes": 1,
"isActive": false,
"startTime": 1673435374,
"endTime": 1673608174
},
{
"subscriptionName": "DEV",
"maxClaims": 25,
"maxShares": 40,
"maxSharesPerSensor": 5,
"maxHistoryDays": 720,
"maxResolutionMinutes": 1,
"isActive": false,
"startTime": 1673435292,
"endTime": 1673608092
}
]
}
}