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

PowerBuilder 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
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
JCC Cyprus
Jira
Lightspeed
MYOB
Magento
Mailgun
Malaysia MyInvois

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
Salesforce
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
TikTok Shop
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

 

 

 

(PowerBuilder) Cerved API Advanced Entity Search

The "Advanced Entity Search" API allows you to find subjects in the Cerved database that meet specific search criteria, specified through the parameters provided as input to the service.

For more information, see https://apps-developer.cerved.com/

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Json
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Subject_id
string ls_Subject_type
string ls_Tax_code
string ls_AddressStreetDescription
string ls_AddressCityCode
string ls_AddressCityIstat_code
string ls_AddressCityDescription
string ls_AddressProvinceCode
string ls_AddressProvinceDescription
string ls_AddressPostal_code
string ls_AddressCountryCode
string ls_AddressCountryDescription
string ls_Company_infoLegal_formCode
string ls_Company_infoLegal_formDescription
string ls_Company_infoLegal_formClass_code
string ls_Company_infoActivity_statusCode
string ls_Company_infoActivity_statusDescription
string ls_Company_infoBusiness_name
string ls_Company_infoEconomic_activityAtecoCode
string ls_Company_infoEconomic_activityAtecoDescription
string ls_Company_infoHead_office
string ls_Company_infoLei_code
string ls_Company_infoOperational_flag
string ls_Company_infoPublic_administrationPa_subject
string ls_Company_infoPublic_administrationPa_supplier
string ls_Company_infoPublic_administrationPa_owned
string ls_Company_infoRea_codeCciaa
integer li_Company_infoRea_codeRea_number
string ls_Company_infoRea_codeRegistration_date
string ls_Company_infoVat_number
string ls_Company_infoNo_rea_dataForm_code
string ls_Company_infoNo_rea_dataForm_description
string ls_Person_infoFirst_name
string ls_Person_infoLast_name
string ls_Person_infoName
string ls_Person_infoBirth_date
string ls_Person_infoBirth_placeStreetDescription
string ls_Person_infoBirth_placeCityCode
string ls_Person_infoBirth_placeCityIstat_code
string ls_Person_infoBirth_placeCityDescription
string ls_Person_infoBirth_placeProvinceCode
string ls_Person_infoBirth_placeProvinceDescription
string ls_Person_infoBirth_placePostal_code
string ls_Person_infoBirth_placeCountryCode
string ls_Person_infoBirth_placeCountryDescription
integer li_Subjects_total_number
integer i
integer li_Count_i

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

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// Implements the following CURL command:

// curl -X POST \
//   https://api.cerved.com/cervedApi/v1/entitySearch/advanced \
//   -H 'accept: application/json' \
//   -H 'apikey: ********************************' \
// -d '{
//   "search_text": "string",
//   "activity_status_codes": [
//     "A",
//     "C",
//     "D",
//     "F",
//     "I",
//     "L",
//     "N",
//     "P",
//     "R",
//     "S",
//     "T"
//   ],
//   "birth_date": "string",
//   "name": "string",
//   "subject_types": [
//     "PERSON",
//     "INDIVIDUAL_COMPANY",
//     "COMPANY",
//     "FOREIGN",
//     "OTHER"
//   ],
//   "tax_code": "string",
//   "vat_number": "string",
//   "rea": {
//     "cciaa": "string",
//     "rea_number": 0
//   },
//   "city_istat_code": "string",
//   "province_code": "string"
// }'

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

// Use this online tool to generate code from sample JSON:
// Generate Code to Create JSON

// The following JSON is sent in the request body.

// {
//   "search_text": "string",
//   "activity_status_codes": [
//     "A",
//     "C",
//     "D",
//     "F",
//     "I",
//     "L",
//     "N",
//     "P",
//     "R",
//     "S",
//     "T"
//   ],
//   "birth_date": "string",
//   "name": "string",
//   "subject_types": [
//     "PERSON",
//     "INDIVIDUAL_COMPANY",
//     "COMPANY",
//     "FOREIGN",
//     "OTHER"
//   ],
//   "tax_code": "string",
//   "vat_number": "string",
//   "rea": {
//     "cciaa": "string",
//     "rea_number": 0
//   },
//   "city_istat_code": "string",
//   "province_code": "string"
// }

loo_Json = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject")

// IMPORTANT:  Only include the lines for the search criteria you wish to include.
loo_Json.UpdateString("search_text","string")
loo_Json.UpdateString("activity_status_codes[0]","A")
loo_Json.UpdateString("activity_status_codes[1]","C")
loo_Json.UpdateString("activity_status_codes[2]","D")
loo_Json.UpdateString("activity_status_codes[3]","F")
loo_Json.UpdateString("activity_status_codes[4]","I")
loo_Json.UpdateString("activity_status_codes[5]","L")
loo_Json.UpdateString("activity_status_codes[6]","N")
loo_Json.UpdateString("activity_status_codes[7]","P")
loo_Json.UpdateString("activity_status_codes[8]","R")
loo_Json.UpdateString("activity_status_codes[9]","S")
loo_Json.UpdateString("activity_status_codes[10]","T")
loo_Json.UpdateString("birth_date","string")
loo_Json.UpdateString("name","string")
loo_Json.UpdateString("subject_types[0]","PERSON")
loo_Json.UpdateString("subject_types[1]","INDIVIDUAL_COMPANY")
loo_Json.UpdateString("subject_types[2]","COMPANY")
loo_Json.UpdateString("subject_types[3]","FOREIGN")
loo_Json.UpdateString("subject_types[4]","OTHER")
loo_Json.UpdateString("tax_code","string")
loo_Json.UpdateString("vat_number","string")
loo_Json.UpdateString("rea.cciaa","string")
loo_Json.UpdateInt("rea.rea_number",0)
loo_Json.UpdateString("city_istat_code","string")
loo_Json.UpdateString("province_code","string")

loo_Http.SetRequestHeader("accept","application/json")
loo_Http.SetRequestHeader("apikey","********************************")

loo_Resp = loo_Http.PostJson3("https://api.cerved.com/cervedApi/v1/entitySearch/advanced","application/json",loo_Json)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_Json
    return
end if

loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")

loo_Resp.GetBodySb(loo_SbResponseBody)
loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")

loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0

Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()

li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
    Write-Debug "Response Header:"
    Write-Debug loo_Resp.Header
    Write-Debug "Failed."
    destroy loo_Resp
    destroy loo_Http
    destroy loo_Json
    destroy loo_SbResponseBody
    destroy loo_JResp
    return
end if

destroy loo_Resp

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

// {
//   "subjects": [
//     {
//       "subject_id": "string",
//       "subject_type": "string",
//       "tax_code": "string",
//       "address": {
//         "street": {
//           "description": "string"
//         },
//         "city": {
//           "code": "string",
//           "istat_code": "string",
//           "description": "string"
//         },
//         "province": {
//           "code": "string",
//           "description": "string"
//         },
//         "postal_code": "string",
//         "country": {
//           "code": "string",
//           "description": "string"
//         }
//       },
//       "company_info": {
//         "legal_form": {
//           "code": "string",
//           "description": "string",
//           "class_code": "string"
//         },
//         "activity_status": {
//           "code": "string",
//           "description": "string"
//         },
//         "business_name": "string",
//         "economic_activity": {
//           "ateco": {
//             "code": "string",
//             "description": "string"
//           }
//         },
//         "head_office": "true",
//         "lei_code": "string",
//         "operational_flag": "true",
//         "public_administration": {
//           "pa_subject": "true",
//           "pa_supplier": "true",
//           "pa_owned": "true"
//         },
//         "rea_code": {
//           "cciaa": "string",
//           "rea_number": 0,
//           "registration_date": "string"
//         },
//         "vat_number": "string",
//         "no_rea_data": {
//           "form_code": "string",
//           "form_description": "string"
//         }
//       },
//       "person_info": {
//         "first_name": "string",
//         "last_name": "string",
//         "name": "string",
//         "birth_date": "string",
//         "birth_place": {
//           "street": {
//             "description": "string"
//           },
//           "city": {
//             "code": "string",
//             "istat_code": "string",
//             "description": "string"
//           },
//           "province": {
//             "code": "string",
//             "description": "string"
//           },
//           "postal_code": "string",
//           "country": {
//             "code": "string",
//             "description": "string"
//           }
//         }
//       }
//     }
//   ],
//   "subjects_total_number": 0
// }

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

li_Subjects_total_number = loo_JResp.IntOf("subjects_total_number")
i = 0
li_Count_i = loo_JResp.SizeOfArray("subjects")
do while i < li_Count_i
    loo_JResp.I = i
    ls_Subject_id = loo_JResp.StringOf("subjects[i].subject_id")
    ls_Subject_type = loo_JResp.StringOf("subjects[i].subject_type")
    ls_Tax_code = loo_JResp.StringOf("subjects[i].tax_code")
    ls_AddressStreetDescription = loo_JResp.StringOf("subjects[i].address.street.description")
    ls_AddressCityCode = loo_JResp.StringOf("subjects[i].address.city.code")
    ls_AddressCityIstat_code = loo_JResp.StringOf("subjects[i].address.city.istat_code")
    ls_AddressCityDescription = loo_JResp.StringOf("subjects[i].address.city.description")
    ls_AddressProvinceCode = loo_JResp.StringOf("subjects[i].address.province.code")
    ls_AddressProvinceDescription = loo_JResp.StringOf("subjects[i].address.province.description")
    ls_AddressPostal_code = loo_JResp.StringOf("subjects[i].address.postal_code")
    ls_AddressCountryCode = loo_JResp.StringOf("subjects[i].address.country.code")
    ls_AddressCountryDescription = loo_JResp.StringOf("subjects[i].address.country.description")
    ls_Company_infoLegal_formCode = loo_JResp.StringOf("subjects[i].company_info.legal_form.code")
    ls_Company_infoLegal_formDescription = loo_JResp.StringOf("subjects[i].company_info.legal_form.description")
    ls_Company_infoLegal_formClass_code = loo_JResp.StringOf("subjects[i].company_info.legal_form.class_code")
    ls_Company_infoActivity_statusCode = loo_JResp.StringOf("subjects[i].company_info.activity_status.code")
    ls_Company_infoActivity_statusDescription = loo_JResp.StringOf("subjects[i].company_info.activity_status.description")
    ls_Company_infoBusiness_name = loo_JResp.StringOf("subjects[i].company_info.business_name")
    ls_Company_infoEconomic_activityAtecoCode = loo_JResp.StringOf("subjects[i].company_info.economic_activity.ateco.code")
    ls_Company_infoEconomic_activityAtecoDescription = loo_JResp.StringOf("subjects[i].company_info.economic_activity.ateco.description")
    ls_Company_infoHead_office = loo_JResp.StringOf("subjects[i].company_info.head_office")
    ls_Company_infoLei_code = loo_JResp.StringOf("subjects[i].company_info.lei_code")
    ls_Company_infoOperational_flag = loo_JResp.StringOf("subjects[i].company_info.operational_flag")
    ls_Company_infoPublic_administrationPa_subject = loo_JResp.StringOf("subjects[i].company_info.public_administration.pa_subject")
    ls_Company_infoPublic_administrationPa_supplier = loo_JResp.StringOf("subjects[i].company_info.public_administration.pa_supplier")
    ls_Company_infoPublic_administrationPa_owned = loo_JResp.StringOf("subjects[i].company_info.public_administration.pa_owned")
    ls_Company_infoRea_codeCciaa = loo_JResp.StringOf("subjects[i].company_info.rea_code.cciaa")
    li_Company_infoRea_codeRea_number = loo_JResp.IntOf("subjects[i].company_info.rea_code.rea_number")
    ls_Company_infoRea_codeRegistration_date = loo_JResp.StringOf("subjects[i].company_info.rea_code.registration_date")
    ls_Company_infoVat_number = loo_JResp.StringOf("subjects[i].company_info.vat_number")
    ls_Company_infoNo_rea_dataForm_code = loo_JResp.StringOf("subjects[i].company_info.no_rea_data.form_code")
    ls_Company_infoNo_rea_dataForm_description = loo_JResp.StringOf("subjects[i].company_info.no_rea_data.form_description")
    ls_Person_infoFirst_name = loo_JResp.StringOf("subjects[i].person_info.first_name")
    ls_Person_infoLast_name = loo_JResp.StringOf("subjects[i].person_info.last_name")
    ls_Person_infoName = loo_JResp.StringOf("subjects[i].person_info.name")
    ls_Person_infoBirth_date = loo_JResp.StringOf("subjects[i].person_info.birth_date")
    ls_Person_infoBirth_placeStreetDescription = loo_JResp.StringOf("subjects[i].person_info.birth_place.street.description")
    ls_Person_infoBirth_placeCityCode = loo_JResp.StringOf("subjects[i].person_info.birth_place.city.code")
    ls_Person_infoBirth_placeCityIstat_code = loo_JResp.StringOf("subjects[i].person_info.birth_place.city.istat_code")
    ls_Person_infoBirth_placeCityDescription = loo_JResp.StringOf("subjects[i].person_info.birth_place.city.description")
    ls_Person_infoBirth_placeProvinceCode = loo_JResp.StringOf("subjects[i].person_info.birth_place.province.code")
    ls_Person_infoBirth_placeProvinceDescription = loo_JResp.StringOf("subjects[i].person_info.birth_place.province.description")
    ls_Person_infoBirth_placePostal_code = loo_JResp.StringOf("subjects[i].person_info.birth_place.postal_code")
    ls_Person_infoBirth_placeCountryCode = loo_JResp.StringOf("subjects[i].person_info.birth_place.country.code")
    ls_Person_infoBirth_placeCountryDescription = loo_JResp.StringOf("subjects[i].person_info.birth_place.country.description")
    i = i + 1
loop


destroy loo_Http
destroy loo_Json
destroy loo_SbResponseBody
destroy loo_JResp

 

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