3.5. VoiceRecord REST Interface

The VoiceRecord REST Interface is very similar to the Developer Garden REST Interface. Therefore, to invoke a REST method, the aquisition of a security token from the Security Token Server is required.

The only difference is that the authentication token for the Voice Record Lab API has to be obtained from a different path at the Security Token Server:

Path for Developer Garden Serviceshttps://sts.idm.telekom.com/rest-v1/tokens/odg
Path for Voice Record Lab APIhttps://sts.idm.telekom.com/rest-v1/tokens/voicerecording

For further information on this procedure, please see the Appendix of the Developer Garden Documentation.

3.5.1. REST Method: Initiate recording of a voice data record

This ressource realizes the method createVoiceRecord

Table 3.13. REST resource information for REST Method: Initiate recording of a voice data record

HTTP MethodPOST
REST URLhttps://esg.i3alab.net/es-odg/voicerecord-service/rest/<environment>/voicerecord

Table 3.14. REST resource path for REST Method: Initiate recording of a voice data record

Path elementMeaning
/esg.i3alab.net/es-odg/voicerecord-service/restURL of the REST interface

/<environment>

The environment in which the service should be used. Possible values are:

  • production

  • sandbox

  • mock

/voicerecord

Table 3.15. Request Parameters for REST Method: Initiate recording of a voice data record

NameDescription

recordingPhoneNo

The underlying voice application calls this phone number and prompts the callee for the voice message to be stored.

startTime (optional)

The call establishment will be started at the given date and time. The startTime needs to be between now and 24 hours in the future.

If no startTime is specified, the call will be established immediately.

The format follows ISO8601 specification.

welcomeMsgMediaObjRef (optional)

URL reference to a voice call data object that stores an individual welcome message prompt.

If no welcome message prompt is specified, the default prompt is used.

goodbyeMsgMediaObjRef (optional)

URL reference to a voice call data object that stores an individual goodbye message prompt which will be played at the end of the recording.

If no goodbye message prompt is specified, the default goodbye message promt is used.

cannotHearYouMsgMediaObjRef (optional)

URL reference to a voice call data object that stores an individual message prompt which will be played when the callee speaks not loud enough.

If no message prompt is specified, the default message prompt is used.

maxRecordingTime (optional)

An application specific maximum recording time for a voice call data object in seconds. This timeout can be used to override the system specific timeout of 30 minutes (1800 seconds), if it is too large. Maximum recording times larger than 30 minutes are forbidden.


REST invocation (example)

Example 3.1. REST request for Method: Initiate recording of a voice data record

POST /es-odg/voicerecord-service/rest/production/voicerecord/ HTTP/1.1 
Host: esg.i3alab.net 
Authorization: TAuth realm="https://odg.t-online.de",tauth_token="<token>" 
Accept: application/json 
Content-type: application/x-www-form-urlencoded 
Content-Length: 59 

recordingPhoneNo=016097xxxxxx&startTime=2010-06-01T12:30:00

Example 3.2. REST response for Method: Initiate recording of a voice data record

HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Tue, 01 Jun 2010 12:30:01 GMT
Content-Type: application/json

{"mediaObjectRef": "moSJwSGsCH3MQNDY5gNmVYDHR7-xxxxxxxxx-1234567890000-1234567890000"}

Table 3.16. Return values for REST Method: Initiate recording of a voice data record

FieldMeaning

mediaObjRef

Unique references to voice call data object to be recorded. The reference is required in order to get either the status or the voice call data object itself.

Table 3.17. Return codes for REST Method: Initiate recording of a voice data record

REST HTTP codeMessage (response body in case of error)

200

OK

400

No phone number was given.

400

The number format is invalid.

400

The number is not allowed.

400

Schedule time format is invalid.

400

Schedule time is invalid.

400

The schedule time exceeded: the number of days until the recording will start is higher than the limit.

401

Token is invalid.

403

Required permissions are missing.

403

The number is not allowed.

404

The environment is invalid.

404

Invalid welcome message URL.

404

Invalid goodbye message URL.

404

Invalid cannot hear you message URL.

406

The accept header is unknown.

500

An internal error occurred.

In case of an error, the detail message is returned as response body:

Example 3.3. Example REST error response

HTTP/1.1 404 Not Found
Transfer-Encoding: chunked
Date: Tue, 01 Jun 2010 12:50:01 GMT
Content-Length: 38
Content-Type: text/plain
Vary: Accept-Encoding

The media object reference is invalid.

Download API Documentation