Create
curl --request POST \
--url https://apimgmt.cometchat.io/apps \
--header 'Content-Type: application/json' \
--header 'key: <key>' \
--header 'secret: <secret>' \
--data '
{
"name": "<string>",
"region": "us",
"version": "3",
"skipSampleData": true
}
'import requests
url = "https://apimgmt.cometchat.io/apps"
payload = {
"name": "<string>",
"region": "us",
"version": "3",
"skipSampleData": True
}
headers = {
"key": "<key>",
"secret": "<secret>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {key: '<key>', secret: '<secret>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', region: 'us', version: '3', skipSampleData: true})
};
fetch('https://apimgmt.cometchat.io/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apimgmt.cometchat.io/apps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'region' => 'us',
'version' => '3',
'skipSampleData' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"key: <key>",
"secret: <secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apimgmt.cometchat.io/apps"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"region\": \"us\",\n \"version\": \"3\",\n \"skipSampleData\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("key", "<key>")
req.Header.Add("secret", "<secret>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apimgmt.cometchat.io/apps")
.header("key", "<key>")
.header("secret", "<secret>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"region\": \"us\",\n \"version\": \"3\",\n \"skipSampleData\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apimgmt.cometchat.io/apps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["key"] = '<key>'
request["secret"] = '<secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"region\": \"us\",\n \"version\": \"3\",\n \"skipSampleData\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<APP_ID>",
"name": "<App Name>",
"plan": "trial",
"trialEndsAt": 1588887393,
"state": "active",
"owner": 1656,
"region": "us",
"createdAt": 1586295393,
"appOwner": {
"id": "1656",
"name": "<OWNER_NAME>",
"email": "youremail@domain.com"
},
"appRegion": {
"id": "us",
"name": "USA",
"description": "The USA region has serverslocated at Ohio."
},
"apiKeys": {
"<API_KEY1>": {
"apiKey": "<API_KEY1>",
"name": "Rest API Key",
"scope": "fullAccess",
"createdBy": "app_system"
},
"<API_KEY2>": {
"apiKey": "<API_KEY2>",
"name": "Auth Key",
"scope": "authOnly",
"createdBy": "app_system"
}
}
}
}App
Create
Creates an app in the account. It returns all the app related information.
POST
/
apps
Create
curl --request POST \
--url https://apimgmt.cometchat.io/apps \
--header 'Content-Type: application/json' \
--header 'key: <key>' \
--header 'secret: <secret>' \
--data '
{
"name": "<string>",
"region": "us",
"version": "3",
"skipSampleData": true
}
'import requests
url = "https://apimgmt.cometchat.io/apps"
payload = {
"name": "<string>",
"region": "us",
"version": "3",
"skipSampleData": True
}
headers = {
"key": "<key>",
"secret": "<secret>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {key: '<key>', secret: '<secret>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', region: 'us', version: '3', skipSampleData: true})
};
fetch('https://apimgmt.cometchat.io/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apimgmt.cometchat.io/apps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'region' => 'us',
'version' => '3',
'skipSampleData' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"key: <key>",
"secret: <secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apimgmt.cometchat.io/apps"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"region\": \"us\",\n \"version\": \"3\",\n \"skipSampleData\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("key", "<key>")
req.Header.Add("secret", "<secret>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apimgmt.cometchat.io/apps")
.header("key", "<key>")
.header("secret", "<secret>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"region\": \"us\",\n \"version\": \"3\",\n \"skipSampleData\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apimgmt.cometchat.io/apps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["key"] = '<key>'
request["secret"] = '<secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"region\": \"us\",\n \"version\": \"3\",\n \"skipSampleData\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<APP_ID>",
"name": "<App Name>",
"plan": "trial",
"trialEndsAt": 1588887393,
"state": "active",
"owner": 1656,
"region": "us",
"createdAt": 1586295393,
"appOwner": {
"id": "1656",
"name": "<OWNER_NAME>",
"email": "youremail@domain.com"
},
"appRegion": {
"id": "us",
"name": "USA",
"description": "The USA region has serverslocated at Ohio."
},
"apiKeys": {
"<API_KEY1>": {
"apiKey": "<API_KEY1>",
"name": "Rest API Key",
"scope": "fullAccess",
"createdBy": "app_system"
},
"<API_KEY2>": {
"apiKey": "<API_KEY2>",
"name": "Auth Key",
"scope": "authOnly",
"createdBy": "app_system"
}
}
}
}Constraints
| Item | Constraint | Notes |
|---|---|---|
| App name | 100 characters (UTF8mb4) | Supports all languages and emojis |
| App version | v3 | Only option available |
| Maximum collaborators per app | 25 | Team management limit |
Body
application/json
Response
200 - application/json
Created App
Show child attributes
Show child attributes
Was this page helpful?
⌘I