diff --git a/components/aircall/actions/retrieve-transcription/retrieve-transcription.mjs b/components/aircall/actions/retrieve-transcription/retrieve-transcription.mjs new file mode 100644 index 0000000000000..26e73e7872d24 --- /dev/null +++ b/components/aircall/actions/retrieve-transcription/retrieve-transcription.mjs @@ -0,0 +1,30 @@ +import app from "../../aircall.app.mjs"; + +export default { + name: "Retrieve Transcription", + description: "Retrieves AI-generated transcription for a specific Aircall call. [See the docs here](https://developer.aircall.io/api-references/#retrieve-a-transcription)", + key: "aircall-retrieve-transcription", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + app, + call: { + propDefinition: [ + app, + "call", + ], + }, + }, + async run({ $ }) { + const { transcription } = await this.app.retrieveTranscription(this.call, $); + + $.export("$summary", `Successfully retrieved transcription with ID ${transcription.id}`); + + return transcription; + }, +}; diff --git a/components/aircall/aircall.app.mjs b/components/aircall/aircall.app.mjs index 6393177c1ecac..5c79b3c7ecb2f 100644 --- a/components/aircall/aircall.app.mjs +++ b/components/aircall/aircall.app.mjs @@ -149,5 +149,11 @@ export default { }, }); }, + async retrieveTranscription(id, $) { + return this._makeRequest({ + path: `calls/${id}/transcription`, + $, + }); + }, }, };