![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Objective-C) VoiceBase -- Retrieve Plain Text TranscriptRetrieves a plain text transcript for a media file.
#import <NSString.h> #import <CkoHttp.h> #import <CkoStringBuilder.h> // This example assumes the Chilkat HTTP API to have been previously unlocked. // See Global Unlock Sample for sample code. // Insert your Bearer token here: NSString *accessToken = @"VOICEBASE_TOKEN"; CkoHttp *http = [[CkoHttp alloc] init]; // Add the access (bearer) token to the request, which is a header // having the following format: // Authorization: Bearer <userAccessToken> CkoStringBuilder *sbAuth = [[CkoStringBuilder alloc] init]; [sbAuth Append: @"Bearer "]; [sbAuth Append: accessToken]; [http SetRequestHeader: @"Authorization" value: [sbAuth GetAsString]]; CkoStringBuilder *sbUrl = [[CkoStringBuilder alloc] init]; [sbUrl Append: @"https://apis.voicebase.com/v2-beta/media/$MEDIA_ID/transcripts/latest"]; int replaceCount = [[sbUrl Replace: @"$MEDIA_ID" replacement: @"f9b9bb88-d52c-4960-bcef-d516a9f85594"] intValue]; http.Accept = @"text/plain"; NSString *strText = [http QuickGetStr: [sbUrl GetAsString]]; if (http.LastMethodSuccess != YES) { NSLog(@"%@",http.LastErrorText); return; } NSLog(@"%@%d",@"Response status code = ",[http.LastStatus intValue]); NSLog(@"%@",strText); if ([http.LastStatus intValue] != 200) { NSLog(@"%@",@"Failed"); } else { NSLog(@"%@",@"Success"); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.