Skip to content

Example of multipart request for custom greeting #75

@cbzink

Description

@cbzink

I'm attempting to create a custom greeting as outlined in the docs: https://developer.ringcentral.com/api-docs/latest/index.html#!#RefCreateUserCustomGreeting. Unfortunately this is failing using both a WAV and MP3 file with a 415 Unsupported Media Type error. Below is an example of my code:

$multipartRequest = $rcsdk->createMultipartBuilder()->setBody([
    'type' => 'Voicemail',
    'answeringRule' => [
        'id' => '[redacted]'
    ],
])->add(fopen('test_greeting.mp3', 'r'))->request('/restapi/v1.0/account/~/extension/[redacted]/greeting');

$response = $rcsdk->platform()->sendRequest($multipartRequest);

Could you provide a working example of createMultipartBuilder for this use case? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions