FUNCTION AUTENTICACAO(clientid,clientsecret,nome,senha,token,cUrl,oListaPedidos,oBanco,oSLFOOD,authorizationCode,authorizationCodeVerifier) clientid := "" clientsecret := "" authorizationCode := "" authorizationCodeVerifier := "" cUrl:= 'https://merchant-api.ifood.com.br/authentication/v1.0/oauth/token' //CRIAR EM JSON cXml:= [client_id=]+clientid+[&client_secret=]+clientsecret+[&grant_type=authorization_code=]+authorizationCode+[&authorization_code=]+[&refreshToken=oBanco=]+authorizationCodeVerifier oHttps:= CreateObject( 'MSXML2.ServerXMLHTTP' ) oHttps:Open( "POST" , cUrl, .F. ) oHttps:setRequestHeader("content-type", "application/x-www-form-urlencoded") oHttps:send(cXml) cc1:= oHttps:ResponseText //PEGAR RESPOSTA JSON aHasRes:= hash() hb_jsondecode(cc1 ,@aHasRes) //Parse JSON to hash token:= aHasRes["accessToken"] Return Nil