Cisco Unity Connection Provisioning Interface (CUPI) API -- Interview Handler Questions APIs

From DocWiki

Jump to: navigation, search

Links to Other API pages: Cisco_Unity_Connection_APIs

CUPI Guide Contents
API Overview
Index of All CUPI Documentation


Contents


Interview Handler Questions APIs

Administrator can use this API to fetch/update the interview questions of a particular interview handler. You can update various attributes of interview handler questions as well using this API.


Listing the Interview Handler Questions

The following is an example of the GET request that fetch the list of interview handler questions:

  GET https://<connection-server>/vmrest/handlers/interviewhandlers/<interviewhandler-
  objectid>/interviewquestions

The following is the response from the above *GET* request and the actual response will depend upon the information given by you:

<InterviewQuestions total="1">
  <InterviewQuestion>
    <InterviewHandlerObjectId>9fa58ed4-af0b-4de5-977c-
  8c080b0727c1</InterviewHandlerObjectId>
    <InterviewHandlerURI>/vmrest/handlers/interviewhandlers/9fa58ed4-af0b-4de5-977c-
  8c080b0727c1</InterviewHandlerURI>
    <QuestionNumber>1</QuestionNumber>
    <MaxMsgLength>30</MaxMsgLength>
    <StreamText>1</StreamText>
    <IsActive>true</IsActive>
  </InterviewQuestion>
</InterviewQuestions>
Response Code: 200

JSON Example

To update the interview handler, do the following:

Request URI:
GET https://<connection-server>/vmrest/handlers/interviewhandlers/<interviewhandler-objectid>/interviewquestions
Accept: application/json
Connection: Keep-alive

The following is the response from the above *GET* request and the actual response will depend upon the information given by you:

{ 
 },{
"@total": "2",
"InterviewQuestion":	[
  {
    "InterviewHandlerObjectId": "99800fcc-e8df-42d3-ac3f-5117483b293e",         
    "InterviewHandlerURI": "/vmrest/handlers/interviewhandlers/99800fcc-e8df-42d3-ac3f-
    5117483b293e",
    "QuestionNumber": "1",
    "MaxMsgLength": "30",
    "StreamText": "1",
    "IsActive": "true"
  },
  {
  "InterviewHandlerObjectId": "99800fcc-e8df-42d3-ac3f-5117483b293e",
  "InterviewHandlerURI": "/vmrest/handlers/interviewhandlers/99800fcc-e8df-42d3-ac3f-
  5117483b293e",
  "QuestionNumber": "2",
  "MaxMsgLength": "30",
  "StreamText": "2",
  "IsActive": "true"
  }
  ]
}
Response Code: 200


Viewing the Specific Interview Handler Question

The following is an example of the GET request that lists the details of interview handler question represented by the provided value of interview handler ID:

  GET https://< connection-server>/vmrest/handlers/interviewhandlers/<Interviewhandler-
  objectid>/interviewquestions/<questionnumber>

The following is the response from the above *GET* request and the actual response will depend upon the information given by you:

  <InterviewQuestion>
      <InterviewHandlerObjectId>9fa58ed4-af0b-4de5-977c-
  8c080b0727c1</InterviewHandlerObjectId>
      <InterviewHandlerURI>/vmrest/handlers/interviewhandlers/9fa58ed4-af0b-4de5-977c-
  8c080b0727c1</InterviewHandlerURI>
      <QuestionNumber>2</QuestionNumber>
      <MaxMsgLength>30</MaxMsgLength>
      <StreamText>2</StreamText>
      <IsActive>true</IsActive>
  </InterviewQuestion>
Response Code: 200


Updating the Interview Handler Questions

The following is an example of the PUT request that can be used to modify an interview handler questions.

PUT https://<connection-server>/vmrest/handlers/interviewhandlers/<interviewhandler-objectid>/interviewquestions/<questionnumber>
Request Body:
<InterviewQuestion>
    <IsActive>false</IsActive>
</InterviewQuestion>
Response Code: 204

JSON Example

To update the interview handler, do the following:

Request URI:
PUT https://<connection-server>/vmrest/handlers/interviewhandlers/<interviewhandler-objectid>/interviewquestions/<questionnumber>
Accept: application/json
Content-Type: application/json
Connection: Keep-alive
Request Body:
{
    "IsActive": "false"
}

The following is the response from the above *PUT* request and the actual response will depend upon the information given by you:

Response Code: 204


Explanation of Data Fields

Parameter Operations Data Type Comments
InterviewHandlerObjectId Read Only String Object id of the parent interview handler.
InterviewHandlerURI Read Only String URI of the parent interview handler.
QuestionNumber Read Only Integer Specifies the question number.Questions are numbered from 1 to 20.
MaxMsgLength Read/Write Integer The maximum recording length (in seconds) allowed for caller responses to the question.

Value can range from 1 to 1200. Default value: 30 seconds

StreamText Read/Write String Specifies the question text. Defaults to the index "1", "2", etc.
IsActive Read/Write Boolean Specifies whether question is active or not

Possible values:

  • true: activate question
  • false: Inactivate question

Default Value: true

VoiceFile Read/Write Specifies the name of the .wav file.


Update the Interview question using the Input Stream

The Interview question can also be updated using the Input Stream. An input stream can be created from the wav file and passed as the request body. The URL for this should be :

PUT https://<connectionserver>/vmrest/handlers/interviewhandlers/<interviewhandlerobjectid>/interviewquestions/
<QuestionNumber>/audio.

The request body will contain an attachment with media type audio/wav. Attachment can be uploaded via application to upload the wave file over HTTPS. Also add the header “content-type” for the request which value will be passed as "audio/wav".

Following URL can be used to listen/get to the question associated with the interview handler: Paste the URL in the browser and listen to the uploaded question..

https://<connectionserver>/vmrest/handlers/interviewhandlers/<interviewhandlerobjectid>/interviewquestions/<QuestionNumber>/audio.

Rating: 0.0/5 (0 votes cast)

Personal tools