fastify-xwhatconverts
recordings.getUrl
Construct the WhatConverts recording API URL for a lead without making a network request.
recordings.getUrl
Synchronously construct the WhatConverts API URL for a lead's call recording. No network request is made. The URL requires Basic Auth credentials to access.
Signature
fastify.xwhatconverts.recordings.getUrl(leadId: string): string
Params
| Name | Type | Required | Description |
|---|---|---|---|
leadId | string | Yes | The WhatConverts lead ID. |
Returns
A string — the full recording API URL (e.g. https://app.whatconverts.com/api/v1/recording?lead_id=123456).
Throws
[xWhatConverts] recordings.getUrl: leadId is required— called withoutleadId.
Examples
Basic — get the recording URL
const url = fastify.xwhatconverts.recordings.getUrl("123456");
console.log(url);
// https://app.whatconverts.com/api/v1/recording?lead_id=123456
Realistic — store URL in database for later retrieval
fastify.post("/leads/:id/save-recording-url", async (request, reply) => {
const { id } = request.params;
const recordingUrl = fastify.xwhatconverts.recordings.getUrl(id);
await db.leads.update({
where: { whatconvertsId: id },
data: { recordingUrl },
});
return { recordingUrl };
});
See Also
- recordings.get — actually fetch the recording as
ArrayBuffer - recordings.getBuffer — fetch as Node.js
Buffer
AI Context
package: "@xenterprises/fastify-xwhatconverts"
method: fastify.xwhatconverts.recordings.getUrl(leadId)
use-when: Synchronously construct the WhatConverts recording API URL without making a network request — store URL in DB or pass to another service
params: leadId (string, required)
returns: string URL (requires Basic Auth to access)
