Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Swift 3,4,5... Web API Examples

Primary Categories

ABN AMRO
AWS Translate
Activix CRM
Adyen
Amazon DynamoDB
Amazon MWS
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bitfinex v2 REST
Bluzone
CallRail
CardConnect
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
ETrade
Etsy
Facebook
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Hungary NAV Invoicing
IBM Text to Speech
Jira
Lightspeed
MYOB

Magento
MercadoLibre
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Okta OAuth/OIDC
OneLogin OIDC
OneNote
PayPal
Peoplevox
Populi
QuickBooks
Rabobank
SMSAPI
SOAP finkok.com
Shippo
Shopify
SimpleTexting
Square
Stripe
SugarCRM
Trello
Twilio
Twitter
VoiceBase
Vonage
Walmart
Walmart v3
WhatsApp
WiX
WooCommerce
Xero
Yousign
_Miscellaneous_
eBay
effectconnect

 

 

 

(Swift 3,4,5...) MercadoLibre - Consultar mis datos personales

Consultar mis datos personales

For more information, see https://developers.mercadolibre.com.ar/es_ar/servicios-consulta-usuarios

Chilkat Downloads for the Swift Programming Language

MAC OS X (Cocoa) Objective-C/Swift Libs

iOS Objective-C/Swift Libs

func chilkatTest() {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let http = CkoHttp()!

    // First get our previously obtained OAuth2 access token.
    let jsonToken = CkoJsonObject()!
    var success: Bool = jsonToken.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

    http.setUrlVar("access_token", value: jsonToken.string(of: "access_token"))

    let sbResponseBody = CkoStringBuilder()!
    success = http.quickGetSb("https://api.mercadolibre.com/users/me?access_token={$access_token}", sbContent: sbResponseBody)
    if success == false {
        print("\(http.lastErrorText!)")
        return
    }

    let jResp = CkoJsonObject()!
    jResp.loadSb(sbResponseBody)
    jResp.emitCompact = false

    print("Response Body:")
    print("\(jResp.emit()!)")

    var respStatusCode: Int = http.lastStatus.intValue
    print("Response Status Code = \(respStatusCode)")
    if respStatusCode >= 400 {
        print("Response Header:")
        print("\(http.lastHeader!)")
        print("Failed.")
        return
    }

    // 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

    var strVal: String?

    var id: Int = jResp.int(of: "id").intValue
    var nickname: String? = jResp.string(of: "nickname")
    var registration_date: String? = jResp.string(of: "registration_date")
    var country_id: String? = jResp.string(of: "country_id")
    var addressState: String? = jResp.string(of: "address.state")
    var addressCity: String? = jResp.string(of: "address.city")
    var user_type: String? = jResp.string(of: "user_type")
    var logo: String? = jResp.string(of: "logo")
    var points: Int = jResp.int(of: "points").intValue
    var site_id: String? = jResp.string(of: "site_id")
    var permalink: String? = jResp.string(of: "permalink")
    var seller_reputationLevel_id: String? = jResp.string(of: "seller_reputation.level_id")
    var seller_reputationPower_seller_status: String? = jResp.string(of: "seller_reputation.power_seller_status")
    var seller_reputationTransactionsPeriod: String? = jResp.string(of: "seller_reputation.transactions.period")
    var seller_reputationTransactionsTotal: Int = jResp.int(of: "seller_reputation.transactions.total").intValue
    var seller_reputationTransactionsCompleted: Int = jResp.int(of: "seller_reputation.transactions.completed").intValue
    var seller_reputationTransactionsCanceled: Int = jResp.int(of: "seller_reputation.transactions.canceled").intValue
    var seller_reputationTransactionsRatingsPositive: Int = jResp.int(of: "seller_reputation.transactions.ratings.positive").intValue
    var seller_reputationTransactionsRatingsNegative: Int = jResp.int(of: "seller_reputation.transactions.ratings.negative").intValue
    var seller_reputationTransactionsRatingsNeutral: Int = jResp.int(of: "seller_reputation.transactions.ratings.neutral").intValue
    var statusSite_status: String? = jResp.string(of: "status.site_status")
    var i: Int = 0
    var count_i: Int = jResp.size(ofArray: "tags").intValue
    while i < count_i {
        jResp.i = i
        strVal = jResp.string(of: "tags[i]")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "buyer_reputation.tags").intValue
    while i < count_i {
        jResp.i = i
        i = i + 1
    }


}

 

© 2000-2020 Chilkat Software, Inc. All Rights Reserved.