How to set resourcename from webclinet as "CustomAppResource" using Rest API?

I want to show which user and which client resources are using openfire from the session.

From Sparks, it’s showing username/Spark,and from my web client, it’s showing username/2352342.
So I want to set my resource name instead of random number

The resource-part of the XMPP address for a user is determined when the user logs in. More specifically, it is the phase called ‘resource binding’ as described in RFC 6120 - Extensible Messaging and Presence Protocol (XMPP): Core

I’m not sure how this relates to the REST API. Assuming that you’re referring to our REST API plugin. This plugin cannot be used to create new sessions. Furthermore, it is an administrative interface that should not be used in/by a client implementation.