User APIs

Add User

OVERVIEW

Overview

Add a new user to Publisher

This API call is used to add a new user object to Publisher

Since v4.6

HTTP Request

POST  /api/2/users

HTTP Request Object

User Object, either in JSON or XML format.

HTTP Headers
HTTP Request Header Description Example
Authorization The API Authorisation token. "Bearer XXXXXXXXXXXXX"
Accept

The format of the expected response. 

  • "application/json"
  • "application/xml"

If no parameter is set, JSON is the default response given.

"application/xml"
Content-Type

The format of the provided content.

  • "application/json"
  • "application/xml"

If no parameter is set, JSON is the expected content by default.

"application/json"

 

HTTP Response

Success

HTTP response 200 with User summary Object 

(Example below)

 

Error

See API Error messages 

 

Example HTTP Request & Response

POST http://example.com/context/api/2/users

 

JSON Request

{

    "user": {

        "name": {

            "firstname": "User",

            "lastname": "Name",

            "title": "Dr"

            },

        "externalid": "456",

        "email": "user@domain.com",

        "phone": "44156680000",

        "jobtitle": "Senior Solution Architect", 

        "mobile": "441561510000",

        "department": "Development",

        "status": "active",

        "organisation": {

            "orgname": "Organisation Pty Ltd",

            "orgid": 75,

            "orgaddressid": 98

        },

        "location": {

            "addressline1": "New London House",

            "addressline2": "6 London Street",

            "city": "London",

            "country": "United Kingdom",

            "postcode": "EC3R 7LP"

        },

        "img": "http://blog.newrelic.com/wp-content/uploads/java-logo.jpg", 

        "sociallinks": {

            "link": {

                "name": "LinkedIn",

                "value": "http://www.linkedin.com/in/user.name"

            }

        },

        "customlinks": {

            "link": {

                "name": "My Web",

                "value": "http://www.mywebsite.com"

            }

        },

        "messaginglinks": {

            "link": {

                "name": "Skype",

                "value": "user.name.skype"

            }

        },

        "secretaryname": "Secretary Name",

        "secretarymail": "secretary@domain.com", 

        "bio": "Development manager",

        "sourcetype": "AD",

        "specialities": "java,dotNet",

    }

}

 

 

JSON Response

{

    "user": {

        "id": 3,

        "email": "user@domain.com",

        "link": "http://example.com/context/api/2/user/3"

}

 

 

Comments


0 Comments

Last Updated: Nov 08,2024