I've been trying to post a voicemail greeting using the sipgate Rest API. The request is sent to https://api.sipgate.com/v2/{userId}/phonelines/{phonelineId}/voicemails/{voicemailId}/greetings .
Unfortunately the server returns a 500 error (Internal Server Error). Does anybody know this problem? Could it be a problem on the server-side of sipgate? Cause other POST/GET requests work fine, just this one has some issue.. I couldn't find anything online about uploading voicemail greetings with sipgate Rest API, so any help is very much appreciated!
Here's a code-snippet with the request in Perl, the authentication is obviously incorrect for security reasons but the problem is not an authentication problem:
my $audio64 = encode_base64($audioData);
my $data = {filename => 'test.mp3', base64Content => $audio64};
my $encodedData = encode_json($data);
my $URL = "https://api.sipgate.com/v2/w0/phonelines/p0/voicemails/v0/greetings";
my $ua = LWP::UserAgent->new;
$ua->ssl_opts( verify_hostname => 0, SSL_verify_mode => 0x00 );
$ua->timeout(20);
my $req = HTTP::Request->new(
'POST',
$URL,
HTTP::Headers->new(
Accept => "application/json",
Authorization => "Basic dadada",
),
$encodedData
);
$req->content_type('application/json');
my $rv = $ua->request( $req );