API Connector Structure

Hello!

Please.

Can someone help me? I am trying to configure it as follows.

I am lost in relation to the structure.

Documentation requires the Oauth 2.0 protocol

I need a direction

I need the answer according to the documentation.

I already have the Token that was generated after the user’s authentication, which is the one below:

code = TG-5f537c09ef14ae0007bb5d3c-506175937

I have also created a new APP on Mercado Livre as shown on the screen

I need this API call to return the “Acces Token” to me.

Hey @asmmonitoramento

Do you have a link to the API documentation in english?
Also there seems to be a few typos in your API call:

  • it should be ‘Content-Type’ instead of ‘Contente-Type’
  • ‘client_secret’ instead of ‘cliente_secret’

Ambroise

Need extra help?

Book a free 15 minutes call - happy to help if I can

Hello ambroisedlg!

I have the documentation link.

However I translated for your better understanding.

I believe I am erring in the assembly and structure of the API in the API Connector

Your json body isn’t formatted correctly.

do you have any similar structure so i can try to copy?

You need to wrap your field names and values in quotes “”

“fieldName” : “value goes here”

great! can you help me understand how this structure would look?

my first experience with Private API

curl -X POST \
-H 'accept: application/json' \
-H 'content-type: application/x-www-form-urlencoded' \
'https://api.mercadolibre.com/oauth/token' \
-d 'grant_type=authorization_code' \
-d 'client_id=$APP_ID' \
-d 'client_secret=$SECRET_KEY' \
-d 'code=$SERVER_GENERATED_AUTHORIZATION_CODE' \
-d 'redirect_uri=$REDIRECT_URI'

“grant_type”: “authorization_code”,
“client_id”: “<$APP_ID>”,
“client_secret”: “<SECRET_KEY>”,
“code”: “<$SERVER_GENERATED_AUTHORIZATION_CODE>”,
“redirect_uri”: “<$REDIRECT_URI>“

right. I’m going back.

which one do i use?

I am not infront of a computer right now but you can try OAuth 2.0 custom token

right

first of all thanks for the support.

I set up the structure this way.

did I correctly?

when I created the app the variables below were generated

Application ID: 410087495354250

Secret Key: zJDcpxgnzLb1Eyc6NtFQGrXGnI64HFBc


following the API tutorials I authenticated with a user account of mine using the link:

https://auth.mercadolivre.com.br/authorization?response_type=code&client_id=410087495354250&redirect_uri=https://flexid.bubbleapps.io/

after authentication it returns to the URL: https://flexid.bubbleapps.io/?code=TG-5f54ddf64e560d0008b9f995-506175937

I’m afraid something is still missing

grant_type value should be authorization_code

note that this field was empty.

see the comparison of image 1 and image 2.

did I do this step correctly?

Yup, what’s the result you get back when you make that call?

I still need to make the API call for an “Access Token” to be returned. Can you help me with the API structure?

Refresh token
Please note that the generated access token will expire 6 hours after being requested. Therefore, to ensure that you can work for a long time and it is not necessary, constantly ask the user to log back in to generate a new token, we offer you the solution of working with a refresh token.

Important:
For this, the application must have selected the option offline_access.
Each time you make the call that changes the code for an access token, you will also have the data for a refresh_token, which you must save to exchange it for an access token once expired.
To renew your access token you must make the following call:

curl -X POST https://api.mercadolibre.com/oauth/token?grant_type=refresh_token&client_id=$APP_ID&client_secret=$SECRET_KEY&refresh_token=$REFRESH_TOKEN

After I create I intend to get the Mercado Livre API ready for the community.