Page 1 of 1

issue sign invalid in call api use postman

Posted: 2023年 Oct 23日 17:48
by namp

I am using the postman to call the api {{url}}/v1.0/token?grant_type=1 from cloudservice, but I still get the sign_invalid error.My url:https://openapi.tuyacn.com. I followed the steps in this tutorial link. https://developer.tuya.com/en/docs/iot/ ... o385w1svns. Create cloud service and transmit clientid,secretid but it still tells me sign_invalid.
Error postman:{
"code": 1004,
"msg": "sign invalid",
"success": false,
"t": 1698056060495,
"tid": "ee733d47718c11eeb7838e9525701b2a"
}
My current account has just been created and activated the free cloudService api package. I am in Vietnam.I did it wrong there What steps? Can anyone help me answer this question? I can't call this api success.Help me !


Re: issue sign invalid in call api use postman

Posted: 2023年 Oct 23日 20:29
by JamesG

Hi,
we have reviewed your request and found that some parameters are missing, such as clientid. Have you already created a project on the cloud development platform? If you have created a project, you can find the AccessID and AccessSecret on the platform after entering the project page, which correspond to the Clientid and Secret environment variables in the Postman tool.


Re: issue sign invalid in call api use postman

Posted: 2023年 Oct 24日 09:58
by namp

Thank You !Can I ask one more question? Is there a way for me to call the api on postman. But can I fake the ip address of china? Because my ip address is in Vietnam.This is error :
{
"code": 2007,
"msg": "your ip(xxx.xx.xxx.xxx) cross-region access is not allowed",
"success": false,
"t": 1698112435222,
"tid": "3061832a721011eeaf4c86d504bf6b23"
}


Re: issue sign invalid in call api use postman

Posted: 2023年 Oct 24日 10:50
by JamesG

Hi,

due to security restrictions in different regions, currently the API services of Chinese data centers can only be accessed by Chinese IPs, and the API services of overseas data centers can only be accessed by overseas IPs.
If you are in Vietnam, you can access the Western America Data Center at https://developer.tuya.com/en/docs/iot/ ... -Endpoints.
By the way, when you start creating a developer project, please select the Western America Data Center as your data center.


Re: issue sign invalid in call api use postman

Posted: 2023年 Oct 24日 12:09
by namp

Thank you ! I called the api to receive the token successfully!


Re: issue sign invalid in call api use postman

Posted: 2024年 May 29日 05:31
by aaron.alva

I have a similar error but I don't know what could be generating it and I always have the same error
"
{
"code": 1004,
"msg": "sign invalid",
"success": false,
"t": 1716931843584,
"tid": "89e841561d3911efb9130e1a774ae1f3"
}
"
help me