Recreate Contact ME Buttons
Hi Community !
Context:
I tried to recreate with the Freemakers and the REST API, the buttons we can find in the users.widget.contact-me component. I need some of these buttons to use them in a custom one.
If I take the Add Friends button as an example. The link structure is the following :
/t5/user/v2/viewprofilepage.addfriend/user-id/7?t:ac=user-id/7&t:cp=notes/contributions/contactactions&ticket=O-E-OfblJ14j_5
I see 4 elements:
- /t5/user/v2/viewprofilepage.addfriend/user-id/n
- t:ac=user-id/n
- t:cp=notes/contributions/contactactions
- ticket=x
Where [n] is the User ID. I find it in the Freemarkers context :
- ${page.context.user.id} or ${user.id}, depending on the page context
Where [x] is the ticket string.
My question:
Where can I call the [x] variable? How to generate it?
I didn’t find anything concerning this ticket string in the doc and in the community posts (nothing inside the REST API or Freemarkers docs).
I only found a Session ID string in the REST API:
- /restapi/vc/authentication/sessions/current/id (link here)
- It seems that it’s not the same string type than the ticket
Other "discovery", about this REST call (Post):
- /restapi/vc/users/id/5/addressbook/contacts/friends/add (link here)
- But I can’t create a link with this call… I can only create an action (AJAX post ?)
- I’m not a fan of this solution: the session ID would be reachable by anyone...
Maybe I'm doing wrong? Beforehand, thank you for your help and your lights ! :smileyhappy:
Best regards,
Stéphane