1

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).

  1. 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>
    
  2. I sent a POST request including the Atom entry as POST data to the designated resource:

  3. 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.

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
mictian2k5
  • 21
  • 4
  • you must have a specific J2EE role for the user who is running through the api. have you set that? – Paul Bastide Mar 11 '14 at 18:22
  • Hi Paul, thanks for your reply! As stated above, the user I'm using has the admin role in Profiles. I also tried mapping the user with the other admin roles (bss-provisioning-admin, org-admin, dsx-admin, search-admin), but without any effect. – mictian2k5 Mar 12 '14 at 06:36
  • it works for me when I give my user the role the role. Have you restarted the server? via browser, login and check this url with the user you set... https://sbtdev.swg.usma.ibm.com:444/profiles/admin/atom/profileService.do if that fails map another user to the role to test. – Paul Bastide Mar 12 '14 at 12:00
  • Hm, that's weird :-\ Must be something with the Connections installations then... The two instances I tried are on 4.5 CR2. I am able to retrieve the Profiles Administration API service document with the user, as well as some other things like retrieving codes. – mictian2k5 Mar 12 '14 at 13:55
  • you may not have the Department set as a field in your map_from_db_repos... or somewhere else in TDI – Paul Bastide Mar 12 '14 at 15:04
  • Department codes were just an example. I can't get it working with any type of Profiles codes. Both Connections instances I have been working with use profiles codes and can be populated using TDI/the Profiles Wizard. I did some further testing with the Admin API and found that upating existing codes does not seem to work either (Server returns 200 OK, but does not update the resource). See update of my original post for more info. Also, thanks again for helping! :-) – mictian2k5 Mar 13 '14 at 05:45
  • Try using a GET with x-method-override: POST – Paul Bastide Mar 15 '14 at 17:51
  • Hi Paul, tried your suggestion. However, the server seems to ignore the header. – mictian2k5 Mar 17 '14 at 10:16
  • sounds like you have a configuration problem, perhaps you should open a Support Request (PMR) – Paul Bastide Mar 17 '14 at 12:19

0 Answers0