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

Unicode C++ 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

 

 

 

(Unicode C++) Azure Monitor - List Activity Logs

Provides the list of records from the activity logs.

Note: The $filter criteria cannot specify a time range that begins more than 90 days in the past.

For more information, see https://docs.microsoft.com/en-us/rest/api/monitor/activitylogs/list

Chilkat C/C++ Library Downloads

MS Visual C/C++

Linux/CentOS C/C++

Alpine Linux C/C++

MAC OS X C/C++

armhf/aarch64 C/C++

C++ Builder

iOS C/C++

Android C/C++

Solaris C/C++

MinGW C/C++

#include <CkHttpW.h>
#include <CkJsonObjectW.h>
#include <CkHttpResponseW.h>

void ChilkatSample(void)
    {
    // This example requires the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttpW http;

    // Load an OAuth2 access token previously fetched by this example:  Get Azure OAuth2 Access Token
    CkJsonObjectW jsonToken;
    bool success = jsonToken.LoadFile(L"qa_data/tokens/azureToken.json");
    // Assuming success..
    http.put_AuthToken(jsonToken.stringOf(L"access_token"));
    wprintf(L"AuthToken: %s\n",http.authToken());

    http.put_Accept(L"application/json");

    CkHttpResponseW *resp = http.QuickRequest(L"GET",L"https://management.azure.com/subscriptions/{subscriptionId}/providers/microsoft.insights/eventtypes/management/values?api-version=2015-04-01&$filter=eventTimestamp%20ge%20%272019-05-16T04%3A36%3A37.6407898Z%27%20and%20eventTimestamp%20le%20%272019-06-12T04%3A36%3A37.6407898Z%27");
    if (http.get_LastMethodSuccess() != true) {
        wprintf(L"%s\n",http.lastErrorText());
        return;
    }

    wprintf(L"Response Status Code: %d\n",resp->get_StatusCode());

    CkJsonObjectW jsonResponse;
    jsonResponse.Load(resp->bodyStr());
    jsonResponse.put_EmitCompact(false);
    wprintf(L"%s\n",jsonResponse.emit());

    if (resp->get_StatusCode() != 200) {
        wprintf(L"Failed.\n");
        delete resp;
        return;
    }

    delete resp;

    // Sample output...
    // (See the parsing code below..)
    // 
    // Use the this online tool to generate parsing code from sample JSON: 
    // Generate Parsing Code from JSON

    // {
    //   "value": [
    //     {
    //       "authorization": {
    //         "action": "microsoft.support/supporttickets/write",
    //         "role": "Subscription Admin",
    //         "scope": "/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/MSSupportGroup/providers/microsoft.support/supporttickets/115012112305841"
    //       },
    //       "caller": "admin@contoso.com",
    //       "claims": {
    //         "aud": "https://management.core.windows.net/",
    //         "iss": "https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/",
    //         "iat": "1421876371",
    //         "nbf": "1421876371",
    //         "exp": "1421880271",
    //         "ver": "1.0",
    //         "http://schemas.microsoft.com/identity/claims/tenantid": "1e8d8218-c5e7-4578-9acc-9abbd5d23315 ",
    //         "http://schemas.microsoft.com/claims/authnmethodsreferences": "pwd",
    //         "http://schemas.microsoft.com/identity/claims/objectidentifier": "2468adf0-8211-44e3-95xq-85137af64708",
    //         "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn": "admin@contoso.com",
    //         "puid": "20030000801A118C",
    //         "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": "9vckmEGF7zDKk1YzIY8k0t1_EAPaXoeHyPRn6f413zM",
    //         "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname": "John",
    //         "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname": "Smith",
    //         "name": "John Smith",
    //         "groups": "cacfe77c-e058-4712-83qw-f9b08849fd60,7f71d11d-4c41-4b23-99d2-d32ce7aa621c,31522864-0578-4ea0-9gdc-e66cc564d18c",
    //         "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name": " admin@contoso.com",
    //         "appid": "c44b4083-3bq0-49c1-b47d-974e53cbdf3c",
    //         "appidacr": "2",
    //         "http://schemas.microsoft.com/identity/claims/scope": "user_impersonation",
    //         "http://schemas.microsoft.com/claims/authnclassreference": "1"
    //       },
    //       "correlationId": "1e121103-0ba6-4300-ac9d-952bb5d0c80f",
    //       "description": "",
    //       "eventDataId": "44ade6b4-3813-45e6-ae27-7420a95fa2f8",
    //       "eventName": {
    //         "value": "EndRequest",
    //         "localizedValue": "End request"
    //       },
    //       "httpRequest": {
    //         "clientRequestId": "27003b25-91d3-418f-8eb1-29e537dcb249",
    //         "clientIpAddress": "192.168.35.115",
    //         "method": "PUT"
    //       },
    //       "id": "/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/MSSupportGroup/providers/microsoft.support/supporttickets/115012112305841/events/44ade6b4-3813-45e6-ae27-7420a95fa2f8/ticks/635574752669792776",
    //       "level": "Informational",
    //       "resourceGroupName": "MSSupportGroup",
    //       "resourceProviderName": {
    //         "value": "microsoft.support",
    //         "localizedValue": "microsoft.support"
    //       },
    //       "operationId": "1e121103-0ba6-4300-ac9d-952bb5d0c80f",
    //       "operationName": {
    //         "value": "microsoft.support/supporttickets/write",
    //         "localizedValue": "microsoft.support/supporttickets/write"
    //       },
    //       "properties": {
    //         "statusCode": "Created"
    //       },
    //       "status": {
    //         "value": "Succeeded",
    //         "localizedValue": "Succeeded"
    //       },
    //       "subStatus": {
    //         "value": "Created",
    //         "localizedValue": "Created (HTTP Status Code: 201)"
    //       },
    //       "eventTimestamp": "2015-01-21T22:14:26.9792776Z",
    //       "submissionTimestamp": "2015-01-21T22:14:39.9936304Z",
    //       "subscriptionId": "089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"
    //     }
    //   ],
    //   "nextLink": "https://management.azure.com/########-####-####-####-############$skiptoken=######"
    // }
    // 

    const wchar_t *nextLink = 0;
    int i;
    int count_i;
    const wchar_t *authorizationAction = 0;
    const wchar_t *authorizationRole = 0;
    const wchar_t *authorizationScope = 0;
    const wchar_t *caller = 0;
    const wchar_t *claimsAud = 0;
    const wchar_t *claimsIss = 0;
    const wchar_t *claimsIat = 0;
    const wchar_t *claimsNbf = 0;
    const wchar_t *claimsExp = 0;
    const wchar_t *claimsVer = 0;
    const wchar_t *claims_identity_claims_tenantid = 0;
    const wchar_t *claims_claims_authnmethodsreferences = 0;
    const wchar_t *claims_identity_claims_objectidentifier = 0;
    const wchar_t *claims_ws_2005_05_identity_claims_upn = 0;
    const wchar_t *claimsPuid = 0;
    const wchar_t *claims_ws_2005_05_identity_claims_nameidentifier = 0;
    const wchar_t *claims_ws_2005_05_identity_claims_givenname = 0;
    const wchar_t *claims_ws_2005_05_identity_claims_surname = 0;
    const wchar_t *claimsName = 0;
    const wchar_t *claimsGroups = 0;
    const wchar_t *claims_ws_2005_05_identity_claims_name = 0;
    const wchar_t *claimsAppid = 0;
    const wchar_t *claimsAppidacr = 0;
    const wchar_t *claims_identity_claims_scope = 0;
    const wchar_t *claims_claims_authnclassreference = 0;
    const wchar_t *correlationId = 0;
    const wchar_t *description = 0;
    const wchar_t *eventDataId = 0;
    const wchar_t *eventNameValue = 0;
    const wchar_t *eventNameLocalizedValue = 0;
    const wchar_t *httpRequestClientRequestId = 0;
    const wchar_t *httpRequestClientIpAddress = 0;
    const wchar_t *httpRequestMethod = 0;
    const wchar_t *id = 0;
    const wchar_t *level = 0;
    const wchar_t *resourceGroupName = 0;
    const wchar_t *resourceProviderNameValue = 0;
    const wchar_t *resourceProviderNameLocalizedValue = 0;
    const wchar_t *operationId = 0;
    const wchar_t *operationNameValue = 0;
    const wchar_t *operationNameLocalizedValue = 0;
    const wchar_t *propertiesStatusCode = 0;
    const wchar_t *statusValue = 0;
    const wchar_t *statusLocalizedValue = 0;
    const wchar_t *subStatusValue = 0;
    const wchar_t *subStatusLocalizedValue = 0;
    const wchar_t *eventTimestamp = 0;
    const wchar_t *submissionTimestamp = 0;
    const wchar_t *subscriptionId = 0;

    nextLink = jsonResponse.stringOf(L"nextLink");
    i = 0;
    count_i = jsonResponse.SizeOfArray(L"value");
    while (i < count_i) {
        jsonResponse.put_I(i);
        authorizationAction = jsonResponse.stringOf(L"value[i].authorization.action");
        authorizationRole = jsonResponse.stringOf(L"value[i].authorization.role");
        authorizationScope = jsonResponse.stringOf(L"value[i].authorization.scope");
        caller = jsonResponse.stringOf(L"value[i].caller");
        claimsAud = jsonResponse.stringOf(L"value[i].claims.aud");
        claimsIss = jsonResponse.stringOf(L"value[i].claims.iss");
        claimsIat = jsonResponse.stringOf(L"value[i].claims.iat");
        claimsNbf = jsonResponse.stringOf(L"value[i].claims.nbf");
        claimsExp = jsonResponse.stringOf(L"value[i].claims.exp");
        claimsVer = jsonResponse.stringOf(L"value[i].claims.ver");
        claims_identity_claims_tenantid = jsonResponse.stringOf(L"value[i].claims.\"http://schemas.microsoft.com/identity/claims/tenantid\"");
        claims_claims_authnmethodsreferences = jsonResponse.stringOf(L"value[i].claims.\"http://schemas.microsoft.com/claims/authnmethodsreferences\"");
        claims_identity_claims_objectidentifier = jsonResponse.stringOf(L"value[i].claims.\"http://schemas.microsoft.com/identity/claims/objectidentifier\"");
        claims_ws_2005_05_identity_claims_upn = jsonResponse.stringOf(L"value[i].claims.\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn\"");
        claimsPuid = jsonResponse.stringOf(L"value[i].claims.puid");
        claims_ws_2005_05_identity_claims_nameidentifier = jsonResponse.stringOf(L"value[i].claims.\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier\"");
        claims_ws_2005_05_identity_claims_givenname = jsonResponse.stringOf(L"value[i].claims.\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname\"");
        claims_ws_2005_05_identity_claims_surname = jsonResponse.stringOf(L"value[i].claims.\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname\"");
        claimsName = jsonResponse.stringOf(L"value[i].claims.name");
        claimsGroups = jsonResponse.stringOf(L"value[i].claims.groups");
        claims_ws_2005_05_identity_claims_name = jsonResponse.stringOf(L"value[i].claims.\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name\"");
        claimsAppid = jsonResponse.stringOf(L"value[i].claims.appid");
        claimsAppidacr = jsonResponse.stringOf(L"value[i].claims.appidacr");
        claims_identity_claims_scope = jsonResponse.stringOf(L"value[i].claims.\"http://schemas.microsoft.com/identity/claims/scope\"");
        claims_claims_authnclassreference = jsonResponse.stringOf(L"value[i].claims.\"http://schemas.microsoft.com/claims/authnclassreference\"");
        correlationId = jsonResponse.stringOf(L"value[i].correlationId");
        description = jsonResponse.stringOf(L"value[i].description");
        eventDataId = jsonResponse.stringOf(L"value[i].eventDataId");
        eventNameValue = jsonResponse.stringOf(L"value[i].eventName.value");
        eventNameLocalizedValue = jsonResponse.stringOf(L"value[i].eventName.localizedValue");
        httpRequestClientRequestId = jsonResponse.stringOf(L"value[i].httpRequest.clientRequestId");
        httpRequestClientIpAddress = jsonResponse.stringOf(L"value[i].httpRequest.clientIpAddress");
        httpRequestMethod = jsonResponse.stringOf(L"value[i].httpRequest.method");
        id = jsonResponse.stringOf(L"value[i].id");
        level = jsonResponse.stringOf(L"value[i].level");
        resourceGroupName = jsonResponse.stringOf(L"value[i].resourceGroupName");
        resourceProviderNameValue = jsonResponse.stringOf(L"value[i].resourceProviderName.value");
        resourceProviderNameLocalizedValue = jsonResponse.stringOf(L"value[i].resourceProviderName.localizedValue");
        operationId = jsonResponse.stringOf(L"value[i].operationId");
        operationNameValue = jsonResponse.stringOf(L"value[i].operationName.value");
        operationNameLocalizedValue = jsonResponse.stringOf(L"value[i].operationName.localizedValue");
        propertiesStatusCode = jsonResponse.stringOf(L"value[i].properties.statusCode");
        statusValue = jsonResponse.stringOf(L"value[i].status.value");
        statusLocalizedValue = jsonResponse.stringOf(L"value[i].status.localizedValue");
        subStatusValue = jsonResponse.stringOf(L"value[i].subStatus.value");
        subStatusLocalizedValue = jsonResponse.stringOf(L"value[i].subStatus.localizedValue");
        eventTimestamp = jsonResponse.stringOf(L"value[i].eventTimestamp");
        submissionTimestamp = jsonResponse.stringOf(L"value[i].submissionTimestamp");
        subscriptionId = jsonResponse.stringOf(L"value[i].subscriptionId");
        i = i + 1;
    }
    }

 

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