Discussions

Ask a Question
Back to All

Bad Request on adding AWS presigned URL in result_url key in talks stream

Hello team,

When I generate a PUT presigned url using AWS SDK it gives a response like this -

https://bucket-name.s3.ap-south-1.amazonaws.com/some/custom/key.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=Axxxxxxxxxx%2F20250514%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20250514T071215Z&X-Amz-Expires=300&X-Amz-Signature=xxxxxxxxxx&X-Amz-SignedHeaders=host&x-amz-checksum-crc32=AAAAAA%3D%3D&x-amz-sdk-checksum-algorithm=CRC32&x-id=PutObject

and adding this url in talk stream url gives Bad Request as response


    const s3remotePath = `some/custom/key.mp4`
    let uploadURL = await generateUploadUrl(s3remotePath)
    const answerResponse = await fetchWithRetries(`${process.env.DID_API_URL}/talks/streams/${streamId}`, {
        method: 'POST',
        headers: {
            Authorization: `Basic ${did.apiKey}`,
            'Content-Type': 'application/json',
            'x-api-key-external': `{"elevenlabs": "${elevenLabsApiKey.apiKey}"}`
        },
        body: JSON.stringify({
            script: {
                type: 'text',
                provider: { type: "elevenlabs", voice_id: assistantDetails.voice },
                input: answer
            },
            result_url: uploadURL,
            config: { stitch: true, fluent: true },
            session_id,
        })
    });


Please let me know what I am doing wrong