Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Visual FoxPro) MercadoLibre - Consultar mis datos personalesConsultar mis datos personales For more information, see https://developers.mercadolibre.com.ar/es_ar/servicios-consulta-usuarios
LOCAL loHttp LOCAL loJsonToken LOCAL lnSuccess LOCAL loSbResponseBody LOCAL loJResp LOCAL lnRespStatusCode LOCAL lcStrVal LOCAL lnId LOCAL lcNickname LOCAL lcRegistration_date LOCAL lcCountry_id LOCAL lcAddressState LOCAL lcAddressCity LOCAL lcUser_type LOCAL lcLogo LOCAL lnPoints LOCAL lcSite_id LOCAL lcPermalink LOCAL lcSeller_reputationLevel_id LOCAL lcSeller_reputationPower_seller_status LOCAL lcSeller_reputationTransactionsPeriod LOCAL lnSeller_reputationTransactionsTotal LOCAL lnSeller_reputationTransactionsCompleted LOCAL lnSeller_reputationTransactionsCanceled LOCAL lnSeller_reputationTransactionsRatingsPositive LOCAL lnSeller_reputationTransactionsRatingsNegative LOCAL lnSeller_reputationTransactionsRatingsNeutral LOCAL lcStatusSite_status LOCAL i LOCAL lnCount_i * This example assumes the Chilkat API to have been previously unlocked. * See Global Unlock Sample for sample code. * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http') loHttp = CreateObject('Chilkat.Http') * First get our previously obtained OAuth2 access token. * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject') loJsonToken = CreateObject('Chilkat.JsonObject') lnSuccess = loJsonToken.LoadFile("qa_data/tokens/mercadolibre.json") * Implements the following CURL command: * curl - X GET https://api.mercadolibre.com/users/me?access_token=$ACCESS_TOKEN * Use the following online tool to generate HTTP code from a CURL command * Convert a cURL Command to HTTP Source Code loHttp.SetUrlVar("access_token",loJsonToken.StringOf("access_token")) * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder') loSbResponseBody = CreateObject('Chilkat.StringBuilder') lnSuccess = loHttp.QuickGetSb("https://api.mercadolibre.com/users/me?access_token={$access_token}",loSbResponseBody) IF (lnSuccess = 0) THEN ? loHttp.LastErrorText RELEASE loHttp RELEASE loJsonToken RELEASE loSbResponseBody CANCEL ENDIF * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject') loJResp = CreateObject('Chilkat.JsonObject') loJResp.LoadSb(loSbResponseBody) loJResp.EmitCompact = 0 ? "Response Body:" ? loJResp.Emit() lnRespStatusCode = loHttp.LastStatus ? "Response Status Code = " + STR(lnRespStatusCode) IF (lnRespStatusCode >= 400) THEN ? "Response Header:" ? loHttp.LastHeader ? "Failed." RELEASE loHttp RELEASE loJsonToken RELEASE loSbResponseBody RELEASE loJResp CANCEL ENDIF * Sample JSON response: * (Sample code for parsing the JSON response is shown below) * { * "id": 202593498, * "nickname": "TETE2870021", * "registration_date": "2016-01-06T11: 31: 42.000-04: 00", * "country_id": "AR", * "address": { * "state": "AR-C", * "city": "Palermo" * }, * "user_type": "normal", * "tags": [ * "normal", * "test_user", * "user_info_verified" * ], * "logo": null, * "points": 100, * "site_id": "MLA", * "permalink": "http://perfil.mercadolibre.com.ar/TETE2870021", * "seller_reputation": { * "level_id": null, * "power_seller_status": null, * "transactions": { * "period": "historic", * "total": 0, * "completed": 0, * "canceled": 0, * "ratings": { * "positive": 0, * "negative": 0, * "neutral": 0 * } * } * }, * "buyer_reputation": { * "tags": [ * ] * }, * "status": { * "site_status": "active" * } * } * Sample code for parsing the JSON response... * Use the following online tool to generate parsing code from sample JSON: * Generate Parsing Code from JSON lnId = loJResp.IntOf("id") lcNickname = loJResp.StringOf("nickname") lcRegistration_date = loJResp.StringOf("registration_date") lcCountry_id = loJResp.StringOf("country_id") lcAddressState = loJResp.StringOf("address.state") lcAddressCity = loJResp.StringOf("address.city") lcUser_type = loJResp.StringOf("user_type") lcLogo = loJResp.StringOf("logo") lnPoints = loJResp.IntOf("points") lcSite_id = loJResp.StringOf("site_id") lcPermalink = loJResp.StringOf("permalink") lcSeller_reputationLevel_id = loJResp.StringOf("seller_reputation.level_id") lcSeller_reputationPower_seller_status = loJResp.StringOf("seller_reputation.power_seller_status") lcSeller_reputationTransactionsPeriod = loJResp.StringOf("seller_reputation.transactions.period") lnSeller_reputationTransactionsTotal = loJResp.IntOf("seller_reputation.transactions.total") lnSeller_reputationTransactionsCompleted = loJResp.IntOf("seller_reputation.transactions.completed") lnSeller_reputationTransactionsCanceled = loJResp.IntOf("seller_reputation.transactions.canceled") lnSeller_reputationTransactionsRatingsPositive = loJResp.IntOf("seller_reputation.transactions.ratings.positive") lnSeller_reputationTransactionsRatingsNegative = loJResp.IntOf("seller_reputation.transactions.ratings.negative") lnSeller_reputationTransactionsRatingsNeutral = loJResp.IntOf("seller_reputation.transactions.ratings.neutral") lcStatusSite_status = loJResp.StringOf("status.site_status") i = 0 lnCount_i = loJResp.SizeOfArray("tags") DO WHILE i < lnCount_i loJResp.I = i lcStrVal = loJResp.StringOf("tags[i]") i = i + 1 ENDDO i = 0 lnCount_i = loJResp.SizeOfArray("buyer_reputation.tags") DO WHILE i < lnCount_i loJResp.I = i i = i + 1 ENDDO RELEASE loHttp RELEASE loJsonToken RELEASE loSbResponseBody RELEASE loJResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.