I followed the documentation (here) to put a request to the Connections Administration API from a Lotusscript agent. Here a summary of the script :
url = "https://connections.mycompany.com/profiles/admin/atom/profileEntry.do?key=1620049a-3d2c-44a2-b378-6f7a6a87a414"
Set webRequest = session.CreateHTTPRequest()
webrequest.preferstrings = True 'if not error contenttype unsupported
Call webRequest.SetHeaderField("Authorization", "Basic " + encodeBase64) 'username:password encoded base64
Call webRequest.SetHeaderField("Content-Type","application/atom+xml")
call webRequest.put(url,body)
MsgBox webRequest.Responsecode 'HTTP/1.1 Bad Request
body is a string that contains the information profile to update :
body = |<?xml version="1.0" encoding="UTF-8"?>|
body = body + |<entry xmlns:app="http://www.w3.org/2007/app" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:fh="http://purl.org/syndication/history/1.0" xmlns:snx="http://www.ibm.com/xmlns/prod/sn" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.w3.org/2005/Atom">|
body = body + |<id>tag:profiles.ibm.com,2006:entry1620049a-3d2c-44a2-b378-6f7a6a87a414</id><category term="profile" scheme="http://www.ibm.com/xmlns/prod/sn/type"></category>|
body = body + |<content type="application/xml"><person xmlns="http://ns.opensocial.org/2008/opensocial"><com.ibm.snx_profiles.attrib>|
body = body + |<entry><key>com.ibm.snx_profiles.base.jobResp</key><value><type>text</type><data>Information to update</data></value></entry>|
body = body + |</com.ibm.snx_profiles.attrib></person></content></entry>|
but it doesn't work and the request response code is "HTTP/1.1 Bad request"
I used postman with exactly the same informations, that's run, the profile is updated
I have no problem with user right or authentification API because if i use the following script to retrieve profile informations, thats run :
url = https://connections.mycompany.com/profiles/admin/atom/profileEntry.do?email=myname@mycompany.com
Set webRequest = session.CreateHTTPRequest()
webrequest.preferstrings = True
Call webRequest.SetHeaderField("Authorization", "Basic " + encodeBase64)
response = webRequest.get(url)
msgbox response 'user profile informations
Does anyone have any idea or experience with this type of query ?
Thanks for your help !