Siebel REST API for the Speech AI Service

The following describes how the REST API for Speech AI service is used:

  1. You call the REST API for Speech AI service via the Speech CreateTranscription API.

    This API allows you to select an audio file present in the Server's local file system. The other request parameters to use when calling the Speech CreateTranscription API are described in the following table.

    Request Parameter Description

    InputFile

    The Audio File to be transcribed to text.

    InputFilePath

    The Audio File path in the Server's local file system. The path should be accessible by the Siebel Server and local to its file system.

    NameSpace

    OCI Namespace of the User/Administrator.

    CompartmentId

    Root Compartment of the OCI bucket.

    InputBucket

    The Bucket where the Audio File will be uploaded. If the InputFilepath is empty, then the API will directly take the Audio file from this bucket.

    InputPrefix

    Folder (or Folder hierarchy) inside the InputBucket where the Audio File is present.

    JobDisplayName:

    Name of the Transcription Job as desired by the User/Administrator. If no value is specified, OCI will use a default job name.

    JobDescription

    Description of the Transcription Job. If no value is specified, then the field remains empty in OCI.

    OutputBucket

    The Bucket where the Transcribed Text File will be stored.

    OutputPrefix

    Folder (or Folder hierarchy) inside the OutputBucket where the Text File is stored.

    OutputFile

    The transcribed Text File name.

    OutputFilePath

    The transcribed Text File path in the Server's local file system. Siebel Server must be able to access this location.

    JobHeartbeatTimer

    The heartbeat interval to check for the Transcription Job. The default value is 10000 milliseconds (=10 seconds). Do not add this parameter to the request payload; allow the default value to persist. In the case of large or small audio files, change the default value by adding the parameter to the request payload

    JobMaxRetries

    The maximum retries to check for the status of the Transcription Job from OCI. The default value is 4. Do not add this parameter to the request payload; allow the default value to persist. In the case of large or small audio files,change the default value by adding the parameter to the request payload. In the case where MaxRetries is exhausted and the Transcription Job has not yet finished (JobStatus is 'In Progress'), the API returns adequately with the Job Id and the necessary details to query the Job further.

  2. After the Speech CreateTranscription API completes authentication, the audio file is uploaded to the OCI bucket.

  3. A Transcription Job is then created which takes the audio file from the InputBucket and converts it to a text file.

    If the job succeeds straightaway, then the transcribed text file is stored in the OutputBucket. The API will further query this location, get the JSON file and download it to the Siebel Server local file system in either JSON or text format (for end user consumption).

    If the job takes longer to complete, then the API returns a Job Status of In Progress in the Response payload. The client will then have to fetch the JobStatus and download the transcribed file once the job completes. These additional actions require the client to call the following API:

  4. The output parameters for the Speech CreateTranscription API are described in the following table.

    Request Parameter Description

    Status

    Status of the operation.

    OutputBucket

    The bucket where the Transcribed Text File is stored.

    OutputPrefix

    The folder name (and path) where the Transcribed File is present in the OCI bucket.

    ObjectLocation

    The Transcribed File name along with the complete folder path (or folder hierarchy) under the OutputBucket.

    OutputPath

    The Transcribed File (in JSON/Text format) with complete path to the Server local file system where it has been downloaded from the OCI bucket.

    NameSpace

    OCI Namespace of the User/Administrator.

    OCID

    OCID of the User/Administrator.

    OPCRequestId

    The Request/transaction ID maintained by OCI. This identifier will be used for any debug or DevOps operation.

Sample API to be Invoked (POST)

https://<hostname:port>/<siebel>/<v1.0>/service/SiebelOCIAIWebService/InvokeOCIAI

Sample Request Payload on Windows

"body" :
   {
       	"Context": "Speech:CreateTranscriptionServices",
       	"CreateTranscriptionServices_Param_1" : "namespace:siebeldev",
       	"CreateTranscriptionServices_Param_2" : "inputBucket:bucket-20220414-1900",
       	"CreateTranscriptionServices_Param_3" : "outputBucket:bucket-20220414-1900",
       	"CreateTranscriptionServices_Param_4" : "jobDisplayName:DEMOJob",
       	"CreateTranscriptionServices_Param_5" : "outputPrefix:DEMOPrefix",    
 	"CreateTranscriptionServices_Param_6" : "compartmentId:ocid1.tenancy.oc1..XXXXX",
  	"CreateTranscriptionServices_Param_7" : "inputFile:oracle-advertising.wav",
  	"CreateTranscriptionServices_Param_8" : "jobDescription:Invoke OCI Speech",
  	"CreateTranscriptionServices_Param_9" : "inputFilePath\\Users\\2024_10C002\\AIMLfiles",
  	"CreateTranscriptionServices_Param_10" : "inputPrefix:Demo",
   	"CreateTranscriptionServices_Param_11" : "outputFilePath: C:\\Users\\2024_10C002\\AIMLfiles ",
       	"CreateTranscriptionServices_Param_12" : "outputFile:oracle-advertisingOracleWAV2.json",
       	"CreateTranscriptionServices_Param_13" : "jobHeartbeatTimer:100000",
       	"CreateTranscriptionServices_Param_14" : "jobMaxRetries:30",
       	"CreateTranscriptionServices_Param_15" : "inputFileName:FIELD=ActivityFileName",
       	"CreateTranscriptionServices_Param_16" : "inputFileExt:FIELD=ActivityFileExt",
       	"CreateTranscriptionServices_Param_17" : "targetLanguageCode:ENU"    
	}

Sample Corresponding Response Payload on Windows

{
	"OutputPath": C:\\Users\\2024_10C002\\AIMLfiles\\oracle-advertisingOracleWAV2.json",
	"ObjectLocation": "DEMOPrefix/job-aXXt3alfa/siebeldev_bucket-20220414-1900/oracle-advertising.wav.json",
	"Namespace": "siebeldev",
	"OutputBucket": "bucket-20220414-1900",
	"OCID": "ocid1.aispeechtranscriptionjob.oc1.apmumbai1.amaXXXXyixjjrmrt3alfa",
	"OPCRequestId": "bom-1:NMuIKvBVFOIWyAVGASsRU5XXXXXXXXX7vkF8Ld_b0GO",
	"Status": "success",
	"JobStatus": "Succeeded",
	"OutputPrefix": "DEMOPrefix/job-amaaaaaa4n2rr5iarea72dfoh75XXXXXXXmrt3alfa/"
}

Sample Request Payload on Unix

"body" :
   {
       "Context": "Speech:CreateTranscriptionServices",
       "CreateTranscriptionServices_Param_1" : "namespace:siebeldev",
       "CreateTranscriptionServices_Param_2" : "inputBucket:bucket-20220414-1900",
       "CreateTranscriptionServices_Param_3" : "outputBucket:bucket-20220414-1900",
       "CreateTranscriptionServices_Param_4" : "jobDisplayName:DEMOJob",
       "CreateTranscriptionServices_Param_5" : "outputPrefix:DEMOPrefix",
       "CreateTranscriptionServices_Param_6" : "compartmentId:ocid1.tenancy.oc1..XXXXX",
       "CreateTranscriptionServices_Param_7" : "inputFile:oracle-advertising.wav",
       "CreateTranscriptionServices_Param_8" : "jobDescription:Invoke OCI Speech",
       "CreateTranscriptionServices_Param_9" : "inputFilePath:/scratch/home/sblqa1/2024_10C002/AIMLfiles",
       "CreateTranscriptionServices_Param_10" : "inputPrefix:Demo",
       "CreateTranscriptionServices_Param_11" : "outputFilePath:/scratch/home/sblqa1/2024_10C002/AIMLfiles",
       "CreateTranscriptionServices_Param_12" : "outputFile:oracle-advertisingOracleWAV2.json",
       "CreateTranscriptionServices_Param_13" : "jobHeartbeatTimer:100000",
       "CreateTranscriptionServices_Param_14" : "jobMaxRetries:30",
       "CreateTranscriptionServices_Param_15" : "inputFileName:FIELD=ActivityFileName",
       "CreateTranscriptionServices_Param_16" : "inputFileExt:FIELD=ActivityFileExt",
       "CreateTranscriptionServices_Param_17" : "targetLanguageCode:ENU"    
}

Sample Corresponding Response Payload on Unix

{
"OutputPath": "/scratch/home/sblqa1/2024_10C002/AIMLfiles/oracle-advertisingOracleWAV2.json", "ObjectLocation": "DEMOPrefix/job-XXXX /siebeldev_bucket-20220414-1900_OnJune15/oracle-advertising.wav.json",
"Namespace": "siebeldev",
"OutputBucket": "bucket-20220414-1900",
"OCID": "ocid1.aispeechtranscriptionjob.oc1.ap-mumbai-1.amaaaaaaXXXXXXXrt3alfa",
"OPCRequestId": "bom-1:NMuIKvBVFOIWyAVGASsRXXXX_b0GO",
"Status": "success",
"JobStatus": "Succeeded",
"OutputPrefix": "DEMOPrefix/job-amaaaaaa4n2rr5iarea72dfXXXXXlfa/"
}