Get User
OVERVIEW
Overview
Get a user from Publisher
This API call is used to retrieve a user from the system. The user identifier is the user id of the user or their email address.
Since v4.6
HTTP Request
GET /api/2/users/<ID>
OR
GET /api/2/users/<EMAIL>
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the user to retrieve |
The email address of the user to retrieve |
HTTP Headers
HTTP Request Header | Description | Example |
---|---|---|
Authorization | The API Authorisation token | "Bearer XXXXXXXXXXXXX" |
Accept |
The format of the expected response.
If no parameter is set, JSON is the default response given. |
"application/xml" |
Content-Type |
The format of the provided content.
If no parameter is set, JSON is the expected content by default. |
"application/json" |
HTTP Response
Success
HTTP response 200 with User object
(Example below)
User doesn't exist Error
If the requested User does not exist:
HTTP response 404
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<summary>The requested user does not exist</summary>
<ref>108</ref>
<link>https://example.com/context/api/2/error/<ERROR ID></link>
</error>
Example HTTP Request & Response
GET
http://example.com/context/api/2/users/3
JSON Response
{
"user": {
"id": 3,
"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",
}
}
XML Response
<user>
<id>3</id>
<name>
<firstname>User</firstname>
<lastname>Name</lastname>
<title>Dr</title>
</name>
<externalid>456</externalid>
<email>user@domain.com</email>
<phone>44156680000</phone>
<jobtitle>Senior Solution Architect</jobtitle>
<mobile>441561510000</mobile>
<department>Development</department>
<status>active</status>
<organisation>
<orgname>Organisation Pty Ltd</orgname>
<orgid>75</orgid>
<orgaddressid>98</orgaddressid>
</organisation>
<location>
<addressline1>New London House</addressline1>
<addressline2>6 London Street</addressline2>
<city>London</city>
<country>United Kingdom</country>
<postCode>EC3R 7LP</postCode>
</location>
<img>http://blog.newrelic.com/wp-content/uploads/java-logo.jpg</img>
<sociallinks>
<link>
<name>LinkedIn</name>
<value>http://www.linkin.com/user.name</value>
</link>
</sociallinks>
<customlink>
<link>
<name>My Web</name>
<value>http://www.mywebsite.com</value>
</link>
</customlink>
<messaginglink>
<link>
<name>Skype</name>
<value>user.name.skype</value>
</link>
</messaginglink>
<secretaryname>Secretary Name</secretaryname>
<secretarymail>secretary@domain.com</secretarymail>
<bio>Development manager</bio>
<sourcetype>AD</sourcetype>
<specialities>java,dotNet</specialities>
</user>
Comments
0 Comments