Chilkat Examples

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

DataFlex Web API Examples

Primary Categories

AWS Translate
Activix CRM
Adyen
Amazon MWS
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bluzone
CardConnect
ClickBank
Clickatell
Cloudfare
DocuSign
ETrade
Etsy
Facebook
GeoOp
GetHarvest
Jira
MYOB

Magento
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Okta OAuth/OIDC
OneLogin OIDC
PayPal
Peoplevox
Populi
QuickBooks
SOAP finkok.com
Shippo
Shopify
Stripe
SugarCRM
Trello
Twitter
VoiceBase
Vonage
Walmart
Walmart v3
Xero
eBay
effectconnect

 

 

 

(DataFlex) VoiceBase -- Retrieve Plain Text Transcript

Retrieves a plain text transcript for a media file.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    String sAccessToken
    Handle hoHttp
    Handle hoSbAuth
    Handle hoSbUrl
    Integer iReplaceCount
    String sStrText
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

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

    // Insert your Bearer token here:
    Move "VOICEBASE_TOKEN" To sAccessToken

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

    // Add the access (bearer) token to the request, which is a header
    // having the following format:
    // Authorization: Bearer <userAccessToken>
    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbAuth
    If (Not(IsComObjectCreated(hoSbAuth))) Begin
        Send CreateComObject of hoSbAuth
    End
    Get ComAppend Of hoSbAuth "Bearer " To iSuccess
    Get ComAppend Of hoSbAuth sAccessToken To iSuccess
    Get ComGetAsString Of hoSbAuth To sTemp1
    Send ComSetRequestHeader To hoHttp "Authorization" sTemp1

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbUrl
    If (Not(IsComObjectCreated(hoSbUrl))) Begin
        Send CreateComObject of hoSbUrl
    End
    Get ComAppend Of hoSbUrl "https://apis.voicebase.com/v2-beta/media/$MEDIA_ID/transcripts/latest" To iSuccess
    Get ComReplace Of hoSbUrl "$MEDIA_ID" "f9b9bb88-d52c-4960-bcef-d516a9f85594" To iReplaceCount

    Set ComAccept Of hoHttp To "text/plain"

    Get ComGetAsString Of hoSbUrl To sTemp1
    Get ComQuickGetStr Of hoHttp sTemp1 To sStrText
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 <> True) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComLastStatus Of hoHttp To iTemp1
    Showln "Response status code = " iTemp1
    Showln sStrText

    Get ComLastStatus Of hoHttp To iTemp1
    If (iTemp1 <> 200) Begin
        Showln "Failed"
    End
    Else Begin
        Showln "Success"
    End



End_Procedure

 

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