This topic has 2 replies, 2 voices, and was last updated 3 years, 6 months ago by aniru2dh.

  • Author
    Posts
  • #21834
     aniru2dh
    Participant

    Hi All,

    I am trying to call Rest API to create a user using below url in Directory services 5.5 but getting an error. I have tried creating a user directly in the backend and tried to get the user details using rest api, it works fine
    ex: http://opendj.web.domain:9080/api/users/test.0?_prettyPrint=true

    Not working :
    http://opendj.web.domain:9080/api/users?_action=create

    json:

    {
    “_id”:”test.1″,
    “_rev”:”00000000b62788d6″,
    “_schema”:”frapi:opendj:rest2ldap:user:1.0″,
    “userName”:”[email protected]”,
    “displayName”:[
    “test.1”
    ],
    “name”:{
    “givenName”:”test112″,
    “familyName”:”test1″
    },
    “contactInformation”:{
    “emailAddress”:”[email protected]
    }
    }

    error:

    {
    “code”: 400,
    “reason”: “Bad Request”,
    “message”: “The request could not be processed because the provided content is not valid JSON”,
    “detail”: “Unexpected character (‘-‘ (code 45)) in numeric value: expected digit (0-9) to follow minus sign, for valid numeric value\n at [Source: [email protected]; line: 1, column: 3]”
    }

    #21835
     Rob Matthews
    Participant

    Hi,

    That looks like it could just be a formatting error, looking at your example some of the speech marks look different and your DisplayName field has escaped on to the next line, was some of it copy/pasted? Perhaps try typing this out manually again.

    #21845
     aniru2dh
    Participant

    @robert-matthews: It is a copy paste, but I did check using an online tool to see if the json was valid or not. it says the json is valid so did not bother of typing this out. Will try it manually and see if it works. Thanks for the reply.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

©2021 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?