Forum Discussion

vbandi's avatar
vbandi
Contributor
9 years ago

RESTAPI Authentication for posting a reply

Hi All,

 

I am developing a module in Windows 10 App to reply to a post.

I am using RESTAPI Session Key for authentication.

These are the steps I followed

1. Got Session key using following

http://testcompany.lithium.com/test/restapi/vc/authentication/sessions/login?user.login='test'&user.password='test'

I use the above url to get Session key which i am able to get successfully.

 

2. I tried to post to the community using the following url

.http://testcompany.lithium.com/test/restapi/vc/messages/id/54/reply?message.body='for testing'&message.subject='testing'

This call fails with error message 

 

User -1 does not have the following permission(s) at Test: [ allow_restapi_call_modify ]

 

I have verified the user do have the permission mentioned above but still it fails.Infact I used Admin login to do the post and still facing the same error.

 

Any pointers!!

 

Thanks,

Vijay

 

5 Replies

  • NicoB's avatar
    NicoB
    Lithium Alumni (Retired)
    9 years ago

    Hi vbandi,

    once you get the session token you should pass it to  your reply call:

    http://testcompany.lithium.com/test/restapi/vc/messages/id/54/reply?message.body='for testing'&message.subject='testing'&restapi.session_key=[SESSION KEY TOKEN]

     

    Nico

  • vbandi's avatar
    vbandi
    Contributor
    9 years ago

    Hi Nico,

     

    Sorry I forgot to mention in my post that i have sent Session Key as query parameters and still i see the issue.

     

    http://testcompany.lithium.com/test/restapi/vc/messages/id/54/reply?message.body='for testing'&message.subject='testing'&&restapi.session_key=Q-St-R11vRAkPGek-FksUqZ68CO15iQdEhyq3icgIQg.

     

    But still i see the same error.

    Any help!

     

     

    Thanks,

    Vijay

  • NicoB's avatar
    NicoB
    Lithium Alumni (Retired)
    9 years ago

    vbandi could you confirm you're using HTTP POST ?

     

    Also, can you check the user's permissions to see whether he/she has rights to perform REST call to modfiy entities?

     

     

  • vbandi's avatar
    vbandi
    Contributor
    9 years ago

    Hi Nico

     

    Yup, the call is post and the user is Administrator and has all rights.

     

    Still not able to get why i am unable to do this call.

     

    Thanks,

    Vijay