Forum Discussion

isxtn's avatar
isxtn
Advisor
3 years ago

What's the easiest way to get the Session Key within a custom component?

My end goal is to be able to 

  1. Edit / update existing post body text
  2. Add tags to a post
  3. Add a cover image to a post or just an image to a post (it's an event type, message)

Maybe using session keys and curl commands might not be the best solution for this, so if you have a better way, please LMK. 

That said,

I've looked at the various documentation about how to retrieve the session key but I am still a bit confused. 

If I am in a component, and the user is logged in, is there a simple way to get the session key? Something like

 

appCache.session

 

or some other esoteric method?

FULL DISCLOSURE: I'm not so familiar with how to use curl except in a terminal.

So even if there's an easier way to edit these things or add tags, please lmk what the easiest way to grab the session key from within a custom component anyway. 

Thanks!

2 Replies

  • I don't think you need session keys for this, but I also think there's something we're missing here. Is simply having a user/mod/event coordinator edit the post to add this information not sufficient?

    If you really need a component, then using the REST API sounds like the place to start: https://developer.khoros.com/khoroscommunitydevdocs/reference/rest

  • isxtn's avatar
    isxtn
    Advisor
    3 years ago

    Wanting to automate some things. So yes, component.

    I thought maybe I needed to use the curl commands and authentication. 

    Thanks 🙂