Permission denied when making a 'Reply' via the REST API.
Hi All,
I am receiving a 'Permission Denied' when trying to make a reply to a message via the REST API.
My user is and 'Administrator' and has the 'Grant' permission 'Make REST API calls with modify access'.
I have read the post 'http://community.lithium.com/t5/Developers-Knowledge-Base/Replying-to-a-post-via-REST-API/ta-p/8569' and
my user has these permissions.
The user is able to make a reply in the GUI via the web with no issues.
It is just via the REST API that this occurrs.
I am migrating content into Lithium from another source and am using a C# application to perform the posts.
I am looping through the content to be migrated and uploading the parent message and child messages (replies).
The parent message uploads just fine. I am able to retrieve the Lithium ID of the parent message for use in the reply
REST API.
Here are the headers for the request and the response.
REQUEST HEADER.
POST http://OURCOMMUNITY/restapi/vc/messages/id/6208/reply?restapi.session_key=VALIDSESSIONKEY HTTP/1.1
Accept: multipart/form-data
Content-Type: application/x-www-form-urlencoded
Host: OURCOMMUNITY
Content-Length: 89
Expect: 100-continue
message.author=%2Fusers%2Fid%2F180&label.labels=Wifi&message.body=This+a+simple+text+test
RESPONSE HEADER.
HTTP/1.1 200 OK
Date: Mon, 22 Jun 2015 22:22:04 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, private
Vary: Accept-Encoding
Connection: close
Content-Type: text/xml;charset=UTF-8
Content-Length: 179
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<response status="error">
<error code="303">
<message>
Permission Denied
</message>
</error>
</response>
Are there some additional steps involved in the posting of a reply va the REST API?
Good to hear you managed to get the post returned wsurguy.
You won't be able to specify the author of the post unless the user making the post has the "switch to other users" permission enabled.
And even then you can't switch to a user that has any permission higher than your own.
Labels on the other hand apply to a topic only. Not an individual post, you wouldn't pass those in with a reply.
You could need to use tags if there's metadata you want to attach to the post.
Sounds like you've got the right permissions working now, but just need a few tweaks to what you're handing to the API :)