I am unable to create a group. What am i missing? How do you use the various api keys?
There are two options you can take to create a group.
- Either you can create a group using the REST API key
- Or login as a user(two approaches), and then a user creates a group.
CREATE A GROUP USING THE REST API
For this you need to first find your REST API KEY:
- Once you login, create or choose an existing app
- On the left navigation of your app, Click on API keys
- Click on Rest API Keys tab on the main content to find them.
- You can also add additional API keys on this page
By default only one REST API Key is created. This is the api key you will need to create a group using REST. We currently don’t have sample code to create a group using REST api, but you can paste you api key, enter a group name and actually hit our API from the documentation page itself .
IF YOU CHOOSE TO ALLOW USERS TO CREATE GROUPS
Creating a group using the client-side SDK requires creating a user and logging in as the user before creating a group.
CREATING A USER
When creating a user using REST - passing the withAuthToken=true will return a token you can login with.
You can now login as this user choosing one of two approaches.
LOGGING IN AS A USER USING AUTHTOKEN
In this approach - you do not need the API key to login, but use a string called the AuthToken (mentioned in previous step when creating a user). You can login as any user using their respective AuthToken. 
LOGGING IN AS A USER USING UID, APIKEY
In this approach - you call CometChat.login() with the uid and api key as parameters.
Once logged in you can allow users to create groups using CometChat.CreateGroup .
Once again to summarize you can either create a group using REST api using 
OR you need to login (two approaches) and then create a group using .
Also note that the group guid when creating a group cannot contain spaces or punctuation apart from hyphen and underscore eg: “my-group” and “old_school” are both allowed, but “rocks!” isn’t.
Hope this helps.
 https://prodocs.cometchat.com/reference#createuser (please use ?withAuthToken=true)