Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

DataFlex Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
Jira
Lightspeed
MYOB
Magento
Mailgun
Mastercard

MedTunnel
MercadoLibre
MessageMedia
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
OpenAI ChatGPT
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
Trello
Twilio
Twitter API v2
Twitter v1
UPS
UniPin
VoiceBase
Vonage
WaTrend
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yapily
Yousign
ZATCA
Zendesk
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(DataFlex) Banco Inter Obtendo uma lista de boletos

See more Banco Inter Examples

Get a list of tickets that match the search criteria.

For more information, see https://developers.bancointer.com.br/reference/pesquisarboletos

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vCert
    Handle hoCert
    Variant vBdPrivKey
    Handle hoBdPrivKey
    String sPrivKeyPassword
    Variant vPrivKey
    Handle hoPrivKey
    Variant vQueryParams
    Handle hoQueryParams
    Variant vResp
    Handle hoResp
    Variant vSbResponseBody
    Handle hoSbResponseBody
    Handle hoJResp
    Integer iRespStatusCode
    String sNomeBeneficiario
    String sCnpjCpfBeneficiario
    Integer iTotalPages
    Integer iTotalElements
    Boolean iLast
    Boolean iFirst
    Integer iSize
    Integer iNumberOfElements
    Integer i
    Integer iCount_i
    String sTemp1
    Boolean bTemp1

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    // Implements the following CURL command:

    // curl \
    //   -X GET \
    //   -H "Authorization: Bearer $TOKEN" \
    //   --cert <nome arquivo certificado>.crt \
    //   --key <nome arquivo chave privada>.key \
    //   --get \
    //   --data-urlencode "dataInicial=2022-04-01" \
    //   --data-urlencode "dataFinal=2022-04-03" \
    //   --data-urlencode "situacao=VENCIDO" \
    //   --data-urlencode "tipoOrdenacao=ASC" \
    //   --data-urlencode "itensPorPagina=10" \
    //   --data-urlencode "paginaAtual=2" \
    //  https://cdpj.partners.bancointer.com.br/cobranca/v2/boletos

    // Use the following online tool to generate HTTP code from a CURL command
    // Convert a cURL Command to HTTP Source Code

    Get Create (RefClass(cComChilkatCert)) To hoCert
    If (Not(IsComObjectCreated(hoCert))) Begin
        Send CreateComObject of hoCert
    End
    Get ComLoadFromFile Of hoCert "<nome arquivo certificado>.crt" To iSuccess
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoCert To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get Create (RefClass(cComChilkatBinData)) To hoBdPrivKey
    If (Not(IsComObjectCreated(hoBdPrivKey))) Begin
        Send CreateComObject of hoBdPrivKey
    End
    Get ComLoadFile Of hoBdPrivKey "<nome arquivo chave privada>.key" To iSuccess
    If (iSuccess = False) Begin
        Showln "Failed to load key"
        Procedure_Return
    End

    // Note: If your private key file requires a password, then set it here.
    // Otherwise pass the empty string.
    Move "" To sPrivKeyPassword
    Get Create (RefClass(cComChilkatPrivateKey)) To hoPrivKey
    If (Not(IsComObjectCreated(hoPrivKey))) Begin
        Send CreateComObject of hoPrivKey
    End
    Get pvComObject of hoBdPrivKey to vBdPrivKey
    Get ComLoadAnyFormat Of hoPrivKey vBdPrivKey sPrivKeyPassword To iSuccess
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoPrivKey To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get pvComObject of hoPrivKey to vPrivKey
    Get ComSetPrivateKey Of hoCert vPrivKey To iSuccess
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoCert To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get pvComObject of hoCert to vCert
    Get ComSetSslClientCert Of hoHttp vCert To iSuccess

    Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
    If (Not(IsComObjectCreated(hoQueryParams))) Begin
        Send CreateComObject of hoQueryParams
    End
    Get ComUpdateString Of hoQueryParams "dataInicial" "2022-04-01" To iSuccess
    Get ComUpdateString Of hoQueryParams "dataFinal" "2022-04-03" To iSuccess
    Get ComUpdateString Of hoQueryParams "situacao" "VENCIDO" To iSuccess
    Get ComUpdateString Of hoQueryParams "tipoOrdenacao" "ASC" To iSuccess
    Get ComUpdateInt Of hoQueryParams "itensPorPagina" 10 To iSuccess
    Get ComUpdateInt Of hoQueryParams "paginaAtual" 2 To iSuccess

    // Adds the "Authorization: Bearer $TOKEN" header.
    Set ComAuthToken Of hoHttp To "$TOKEN"

    Get pvComObject of hoQueryParams to vQueryParams
    Get ComQuickRequestParams Of hoHttp "GET" "https://cdpj.partners.bancointer.com.br/cobranca/v2/boletos" vQueryParams To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
    If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
        Send CreateComObject of hoSbResponseBody
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComGetBodySb Of hoResp vSbResponseBody To iSuccess

    Get Create (RefClass(cComChilkatJsonObject)) To hoJResp
    If (Not(IsComObjectCreated(hoJResp))) Begin
        Send CreateComObject of hoJResp
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComLoadSb Of hoJResp vSbResponseBody To iSuccess
    Set ComEmitCompact Of hoJResp To False

    Showln "Response Body:"
    Get ComEmit Of hoJResp To sTemp1
    Showln sTemp1

    Get ComStatusCode Of hoResp To iRespStatusCode
    Showln "Response Status Code = " iRespStatusCode
    If (iRespStatusCode >= 400) Begin
        Showln "Response Header:"
        Get ComHeader Of hoResp To sTemp1
        Showln sTemp1
        Showln "Failed."
        Send Destroy of hoResp
        Procedure_Return
    End

    Send Destroy of hoResp

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "totalPages": 1,
    //   "totalElements": 58,
    //   "last": true,
    //   "first": true,
    //   "size": 100,
    //   "numberOfElements": 58,
    //   "content": [
    //     {
    //       "nomeBeneficiario": "nome do beneficiario 1",
    //       "cnpjCpfBeneficiario": "CNPJ/CPF beneficiario 1"
    //     },
    //     {
    //       "nomeBeneficiario": "nome do beneficiario 2",
    //       "cnpjCpfBeneficiario": "CNPJ/CPF beneficiario 2"
    //     },
    //     {
    //       "nomeBeneficiario": "nome do beneficiario N",
    //       "cnpjCpfBeneficiario": "CNPJ/CPF beneficiario N"
    //     }
    //   ]
    // }

    // Sample code for parsing the JSON response...
    // Use the following online tool to generate parsing code from sample JSON:
    // Generate Parsing Code from JSON

    Get ComIntOf Of hoJResp "totalPages" To iTotalPages
    Get ComIntOf Of hoJResp "totalElements" To iTotalElements
    Get ComBoolOf Of hoJResp "last" To iLast
    Get ComBoolOf Of hoJResp "first" To iFirst
    Get ComIntOf Of hoJResp "size" To iSize
    Get ComIntOf Of hoJResp "numberOfElements" To iNumberOfElements
    Move 0 To i
    Get ComSizeOfArray Of hoJResp "content" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComStringOf Of hoJResp "content[i].nomeBeneficiario" To sNomeBeneficiario
        Get ComStringOf Of hoJResp "content[i].cnpjCpfBeneficiario" To sCnpjCpfBeneficiario
        Move (i + 1) To i
    Loop



End_Procedure

 

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