I am currently working on a piece of software which should - among other things - be able to create/update profiles codes in IBM Connections' Profiles feature.
In my opinion I did everything as documented in the IBM Social Business Development Wiki but was unable to create profiles codes (tested on two different Installations with same results).
Attempt: Creating profiles codes
I have tried the following steps with the different kinds of profiles codes (Country, Department, ...), always with the same result from the server (405 Method not allowed).
I've assembled an Atom entry for the code I wanted to created, e.g. Department:
<entry xmlns="http://www.w3.org/2005/Atom"> <id>tag:profiles.ibm.com,2006:com.ibm.snx_profiles.codes.department:mgmt</id> <title type="text">mgmt</title> <category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="profiles.codes"/> <content type="application/xml"> <appData xmlns="http://ns.opensocial.org/2008/opensocial"> <com.ibm.snx_profiles.codes.department.departmentCode>mgmt</com.ibm.snx_profiles.codes.department.departmentCode> <com.ibm.snx_profiles.codes.department.departmentTitle>Management</com.ibm.snx_profiles.codes.department.departmentTitle> </appData> </content> </entry>
I also tried a shorter entry with just the ID tag (like shown in the documentation):
<entry> <id>tag:profiles.ibm.com,2006:com.ibm.snx_profiles.codes.department:mgmt</id> </entry>
I sent a POST request including the Atom entry as POST data to the designated resource:
- e.g. https://connections.mycompany.com/profiles/admin/atom/codes/Department.do
- The request is authenticated using Basic authentication (user has admin role)
- The request's Content-Type is set to application/atom+xml
(I tried sending the request from code (Java + Apache Abdera/HTTPClient) as well as using the RESTClient AddOn for Firefox.)
Server responds with 405 Method not allowed
<?xml version="1.0" encoding="UTF-8"?> <error xmlns="http://www.ibm.com/xmlns/prod/sn"> <code> 405 </code> <message> CLFRN1170E: Resource not found. </message> <trace> OMITTED </trace> </error>
Also, if an OPTION request is sent to the resource URL, the server responds with: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS
So, I was wondering if there are people out there who managed to get this working... Maybe I'm missing something (some kind of configuration on the server's side) or maybe it's just broken for me...
Working with Connections' APIs has been a really frustrating experience for me so far (either due to lack of documentation or because of APIs not working as documented)... Hopefully these things will get better in future releases :-\
Anyway, thanks for taking the time reading all this; any help is much appreciated!
Cheers, Karl
Update (2014-03-13)
I did some additional testing with the API around Profiles codes... Here are my findings:
- POSTing (creating) Profiles codes always results in a 405 (Method not allowed) response by the server
- PUTing (updating) Profiles codes returns 200 OK, but the codes never get updated
- GETing (retrieving) Feeds of profiles codes works fine
- DELETEing profiles codes also works fine
GETing individual profiles codes (using codeId query-parameter) works fine, except for:
when the specified codeId does not exist, the server returns 200 OK with just an XML-definition (but no Atom/XML)
<?xml version="1.0" encoding="UTF-8"?>
Today, I might have the chance to test the requests one two more Connections installations and see if the results differ from the two instances I've been working with so far.
Update 2 (2014-03-13)
I have now tested the following request (as well as others) against four different Connections installations - all giving me the same result of 405 Method not allowed
curl --user {username} -X POST -H "Content-Type: application/atom+xml" -d "<entry><id>tag:profiles.ibm.com,2006:com.ibm.snx_profiles.codes.department:test</id></entry>" https://connections.mycompany.com/profiles/admin/atom/codes/Department.do
Update 3 (2014-07-08)
After updating to IBM Connections 5, creating/updating of profiles codes now works as it should. Seems like it was a bug after all.