Accepting an invitation to become a colleague
Added by IBM contributorIBM | Edited by Claudia R Elbourn on June 15, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

To accept an invitation to be a colleague, send an updated connection document in Atom format to the existing connection's edit web address.

After you accept a connection, the status of the connection in your connections is changed from pending to accepted and the status of the connection in the invitee's list of connections is changed from unconfirmed to accepted. To decline the invitation, delete it by sending a DELETE HTTP request to the resource.
 

All existing connection information will be replaced with the new data. To avoid deleting all existing data, retrieve any data you want to retain first, and send it back with this request. See Inviting a person to become your colleague for more information.

To accept an invitation to be a colleague, send an updated connection document in Atom format to the existing connection's edit web address. The person who recieved the invite MUST be the one to accept - not the sender, a Profiles Admin can accept the invite also. You can only accept or decline a connections invite if you know that you have a pending invite and who the invite is from, either by email or userid.

To decline the invitation, delete it by sending a DELETE HTTP request to the resource.

Process

To accept a colleague invitation:
1. Retrieve any user's Profiles service document using the user's credentials to authenticate the request. See Retrieving the Profiles service document

2. In the service document, find the href attribute value where the value of the rel attribute is http://www.ibm.com/xmlns/prod/sn/connections/colleague

3. Append the parameter and value "status=pending" to the URI from step 2.
https://enterprise.example.com/profiles/atom/connections.do?connectionType=colleague&email=UsersEmail@emailservice.com&status=pending

4. In the resulting feed, find the value of the href attribute where the value of the rel attribute is "self". The link should look similar to this:

https://enterprise.example.com/profiles/atom/connection.do?connectionId=cbe633f1-4dbe-4eb1-a997-8d4d10533eeb

5. Using the link from step 4, perform a PUT operation using an Atom entry document for the payload. Be sure to change the value of the term attribute of the category element with the attribute value of scheme="http://www.ibm.com/xmlns/prod/sn/status" from pending to accepted. The content type of the Atom entry document must be application/atom+xml. Note: this PUT request should use the credentials of the recipient of the invitation, not the sender.

Input
Method URI Description
PUT /profiles/atom/connection.do Value of the href attribute of the <link> element that has a rel="edit" attribute value for each entry in the colleague connections feed.
Content Type: application/atom+xml
Sample Request:
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

  <title type="text">Bill User45</title>
  <category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="connection"/>
  <category scheme="http://www.ibm.com/xmlns/prod/sn/connection/type" term="colleague"/>
  <category scheme="http://www.ibm.com/xmlns/prod/sn/status" term="accepted"/>
  <content type="html">

    just friends of Bill

	</content>
</entry>
Name Type Optional Description
email
string Yes The email for the person who will be accepting the invite. Must include an email or UID
inclMessage
boolean Yes Do you want the message to be included in the return entry.
connectionId
string No The unique id number of the colleague connection.
Output
Code Description
200
OK. Indicates that the request was received successfully.
401
Unauthorized. Returned when no authenticated user or no userid, email, or key parameter are provided on the request.
404
Item not Found
Examples
This is an example of accepting an invite using: PUT /profiles/atom/connection.do?connectionId=65cc71d1-07da-452c-9a2c-8adc49680557
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
  <id>tag:profiles.ibm.com,2006:entry65cc71d1-07da-452c-9a2c-8adc49680557</id>
  <title type="text">Bill User45</title>
  <category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="connection"/>
  <category scheme="http://www.ibm.com/xmlns/prod/sn/connection/type" term="colleague"/>
  <category scheme="http://www.ibm.com/xmlns/prod/sn/status" term="accepted"/>
  <content type="html">

    just friends of Bill

	</content>
</entry>

Response returned by the server
HTTP/1.1 200 OK