I am trying to access the external API “green-api”
This is an API service for WhatsApp. It has an endpoint:
https://1103.api.green-api.com/waInstance1111111/getChatHistory/someInstanceId
When I try to contact via Postman, I get a response and everything works fine, but as soon as I try to do this in the code, I get error 429
const getChatHistory = async () => {
try {
return await axios.post(
`https://1103.api.green-api.com/waInstance1103186061/getChatHistory/f1cc1d63a5d8416e8a70966edc85fa0e71955523321d45c3a2`,
{ chatId: '[email protected]' },
{
withCredentials: false,
}
)
} catch (error: any) {
console.log(error)
}
}
useEffect(() => {
getChatHistory().then((res) => setMessages(res?.data))
console.log(messages)
}, [])