Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(DataFlex) VoiceBase -- Retrieve Plain Text TranscriptRetrieves a plain text transcript for a media file.
Use ChilkatAx-win32.pkg Procedure Test String sAccessToken Handle hoHttp Handle hoSbAuth Boolean iSuccess 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-2024 Chilkat Software, Inc. All Rights Reserved.