Hi everyone, I'm having trouble requesting information from the Mercado Livre API. Could someone help me? I've already done all the configurations, but I need to obtain the first access token and I'm stuck on this part. If anyone has managed to use it before, could you help me?
The issue happens because OutSystems sends requests using application/json by default, but Mercado Livre expects the data in application/x-www-form-urlencoded format. To fix this, simply update your request header: Change the header Content-Type: application/json to Content-Type: application/x-www-form-urlencoded After that, ensure the body is formatted accordingly.
I'll do that and come back here with the answer, okay? Thank you
I managed to solve the problem of not being able to generate the access token, but now I'm having a problem with the request. When I do the GET request using: https://api.mercadolibre.com/products/search?site_id={site_id}&q={q}&status={status} it only finds products using the MLA site_id, as in the Mercado Libre example. However, when I try to use, for example, MLB, which is from Brazil, it returns empty. What could be the problem? Thank you in advance for your attention.
Great. Glad it's all working.
If it's all ok just mark the solution and close the ticket.
Regards.
Gonçalo Almeida
Hello.
The documentation is quite complete. Where are you stuck?
https://developers.mercadolivre.com.br/pt_br/autenticacao-e-autorizacao
Hi @Daniel Cabral Can you share more information about the issue? what do you mean by "done all the configurations"?
I got to the part where I put: https://api.mercadolibre.com/oauth/token in the URL of the POST method, and then I looked at the documentation and saw that I need to change the format I need to send the POST because the MercadoLibre API doesn't accept JSON. I couldn't complete those steps.