Community articleChecking whether two people are colleagues
Added by IBM contributorIBM on March 11, 2014
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Returns an entry of the colleague connection if one exists.



Returns an entry of the colleague connection if one exists.

See Authenticating requests for information about how to authenticate the request.

Use one or more of the input parameters to narrow the search. Separate multiple parameters using an ampersand (&).

Input
Method URI Description
GET /profiles/atom/connection.do Value of the href attribute of the <link rel="self"> element of each entry in the colleague connections feed.
Retrieves the connection if one exists between the two people specified as the <source> and <target> of the connection. Use the source and target parameters listed below to specify values for them.
HEAD /profiles/atom/connection.do Retrieves just HTTP headers indicating whether a connection exists between the two people specified as the <source> and <target> of the connection. Use the source and target parameters listed below to specify values for them. You can use this operation to quickly find out the status of a connection.
Name Type Optional Description
connectionType
string No Identifies the type of connection to look for. You must specify connectionType=colleague. Required.
inclMessage
boolean Yes Specifies whether or not to include the invitation message with the returned entries. This parameter accepts a Boolean value of true or false. If you include this parameter and set it to true, you must be the source of the connection object and you must authenticate the request.
sourceEmail
string Yes Internet email address of the user whose colleagues you want to retrieve.
Format the HTTP request using the proper URL encoding. For example, the encoded form of the @ symbol is %40 as in:
adam_eventide%40garden.com
Note: Do not use this parameter if IBM® Connections is configured to prevent email addresses from being displayed. It will return an error code 400 for an invalid request. Use the key or userid parameters instead.
sourceKey
string Yes An ID generated by Profiles to identify a person.
Note: A user's key value is contained in the element with a class attribute value of x-profile-key in the user's profile feed. You can access a user's feed by searching all profiles by name, which returns information you can then use to retrieve the person's feed.
sourceUserid
string Yes A unique ID that represents a specific person. To determine a person's user ID, you can search all profiles for the person by name. The feed that is returned identifies the person's user ID in the <snx:userid> element.
targetEmail
string Yes Internet email address of the user whose colleagues you want to retrieve.
Format the HTTP request using the proper URL encoding. For example, the encoded form of the @ symbol is %40 as in:
adam_eventide%40garden.com
Note: Do not use this parameter if IBM Connections is configured to prevent email addresses from being displayed. It will return an error code 400 for an invalid request. Use the key or userid parameters instead.
targetKey
string Yes An ID generated by Profiles to identify a person.
Note: A user's key value is contained in the element with a class attribute value of x-profile-key in the user's profile feed. You can access a user's feed by searching all profiles by name, which returns information you can then use to retrieve the person's feed.
targetUserid
string Yes A unique ID that represents a specific person. To determine a person's user ID, you can search all profiles for the person by name. The feed that is returned identifies the person's user ID in the <snx:userid> element.
Output
Content Type: application/atom+xml
Name Type Optional Description
X-Profiles-Connection-Type: colleague
string Yes Indicates that a colleague connection exists.
X-Profiles-Connection-Status: accepted
enumerated Yes Indicates the status of the connection. Possible status options are:
accepted
The person was invited to participate in a connection and has accepted the invitation.
pending
The person was invited to participate in a connection, but has not responded to the invitation yet.
unconfirmed
The person has invited someone to participate in a connection, but the invitation has not yet been accepted or deleted.
Authorized values:
  • accepted
  • pending
  • unconfirmed
Code Description
200
Indicates a connection exists between the two users specified. If no connection is found or an error occurs, this header will contain one of the error codes below.
404
Not Found: No connection was found between the two users specified
400
Bad Request.