cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
701
Views
1
Helpful
2
Replies

Unity Connection Add User

rajesh00111
Level 1
Level 1

hi ,

In Unity Connection 10.0 version i tried to Add local user and Import Active directory User but for both request iam getting the error like    [Fatal Error] :1:1: Content is not allowed in prolog. iam using REST API to Add User for Post request only iam getting this error ,but USER is added into the server for DELETE ,PUT and GET request iam getting response 204. for POST Not getting any response code instead of this getting the above error what i mentioned.

my code

=============================================================

req = new CUPIRESTRequest( 'path': path , body: [ "Alias":"raghu","DtmfAccessId":"112233","FirstName":"Raghavendra","LastName":"Mankar","EmailAddress":"raghu@ymail.com" ], contentType: 'application/json' );

def res=client.post( req );

public Response post(CUPIRESTRequest cupiRequest) {

  log.info "Executing CUPI Request For ${cupiRequest.path} - Start"

  def res = client?.post(path: cupiRequest.path) {

  type cupiRequest.contentType

  json  cupiRequest.body

  }

  log.info "Executing CUPI Request For ${cupiRequest.path} - Start"

  return res;

  }

======================================================================================

In cisco developer api  given as follow

===============================

POST https://<Connection-server>/vmrest/users?templateAlias=voicemailusertemplate

Accept: application/json

Content_type: application/json

Connection: keep_alive

Request Body:

{

  "Alias":"voicemailusertemplate1",

  "DisplayName":"Voice Mail User Template 1"

}

Thanks,

2 Replies 2

dstaudt
Cisco Employee
Cisco Employee

From the raw HTTP request, it looks like 'Content_type' should be 'Content-Type'.

'Content is not allowed in prolog' is pretty indicative of an XML parser finding a problem with the very beginning of an XML document.  I'm guessing that because of the malformed Content-Type header, VMREST defaults to assuming the content is XML, which fails to parse as the content is actually JSON.

hi ,

iam able to post the data and it is saved in server using my code but iam not getting any response from the server i tried to post a xml data but same problem iam facing...

thanks,