# About Session Register api usage

**URL:** <https://forum.social.plus/t/about-session-register-api-usage/348>\
**Category:** Web\
**Created:** [November 3, 2021, 7:54am UTC](https://forum.social.plus/t/about-session-register-api-usage/348 "2021-11-03T07:54:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlezip](https://avatars.discourse-cdn.com/v4/letter/t/da6949/32.png) [@tlezip](https://forum.social.plus/u/tlezip)\
**Post date:** [November 3, 2021, 7:54am UTC](https://forum.social.plus/t/about-session-register-api-usage/348/1 "2021-11-03T07:54:55Z")

</div>

As we talked here

> [@Comments moderation](https://forum.social.plus/t/comments-moderation/345/3):
>
> Comment can be created via our Admin API: [Swagger UI](https://api-docs.amity.co/#/Comment) - however the creator of the comment will be the admin who owns the token used to invoke the API. For this one, is there a way to comment with API and make creator to be user that’s not admin (normal user)?

We want to try to use session regiester api, seem like here are required fields  
Header

- x-api-key  
Body
- userId
- deviceId
- deviceInfo
- displayName
- authToken

My question are

- For x-api-key, value will be the same as apiKey that we use for eko-sdk right?

- For deviceId, deviceInfo - how can I get theses value? or what value should be?

- Seem like to get authToken we’ll have to get it from /authentication/token api, but that api require header name x-server-key, So how can I get that server key?

As I tried to put apiKey that we used for eko-sdk as server key, I got error Invalid server key.

---

<div class="post-metadata">

**Author:** ![touchaponk](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@touchaponk](https://forum.social.plus/u/touchaponk)\
**Post date:** [November 4, 2021, 3:23am UTC](https://forum.social.plus/t/about-session-register-api-usage/348/2 "2021-11-04T03:23:29Z")

</div>

Hi @tlezip -

1. yes `x-api-key` is the API Key you use
2. `deviceId` would identify the user device - in the case you’re calling from your server a deviceId may just be `server-user-5837` to represent that it’s your server calling on the behalf of `user-5837`
3. server key can be obtained from ASC Console - please note that this will require you to enable secure mode and all SDK init call will then need to always use `authToken` - this must be turned on in production system. [https://docs.amity.co/console/settings/security](https://docs.amity.co/console/settings/security)

---

<div class="post-metadata">

**Author:** ![tlezip](https://avatars.discourse-cdn.com/v4/letter/t/da6949/32.png) [@tlezip](https://forum.social.plus/u/tlezip)\
**Post date:** [November 4, 2021, 4:52am UTC](https://forum.social.plus/t/about-session-register-api-usage/348/3 "2021-11-04T04:52:05Z")

</div>

Thank you for explanation.

What about deviceInfo parameter?

---

<div class="post-metadata">

**Author:** ![touchaponk](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@touchaponk](https://forum.social.plus/u/touchaponk)\
**Post date:** [November 4, 2021, 5:09am UTC](https://forum.social.plus/t/about-session-register-api-usage/348/4 "2021-11-04T05:09:47Z")

</div>

It’s optional - you can omit the parameter
