Create website
curl --request POST \
--url https://admin.snagsolutions.io/api/websites \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "My New Website",
"organizationId": "123e4567-e89b-12d3-a456-426614174001",
"adminWalletAddress": [
"0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"0x66f820a414680b5bcda5eeca5dea238543f42054"
],
"twitterUsername": "@mywebsite",
"discordUrl": "https://discord.gg/mywebsite",
"telegramUrl": "https://t.me/mywebsite",
"instagramUsername": "@mywebsite",
"homeUrl": "https://www.mywebsite.com"
}
'import requests
url = "https://admin.snagsolutions.io/api/websites"
payload = {
"name": "My New Website",
"organizationId": "123e4567-e89b-12d3-a456-426614174001",
"adminWalletAddress": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "0x66f820a414680b5bcda5eeca5dea238543f42054"],
"twitterUsername": "@mywebsite",
"discordUrl": "https://discord.gg/mywebsite",
"telegramUrl": "https://t.me/mywebsite",
"instagramUsername": "@mywebsite",
"homeUrl": "https://www.mywebsite.com"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My New Website',
organizationId: '123e4567-e89b-12d3-a456-426614174001',
adminWalletAddress: [
'0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
'0x66f820a414680b5bcda5eeca5dea238543f42054'
],
twitterUsername: '@mywebsite',
discordUrl: 'https://discord.gg/mywebsite',
telegramUrl: 'https://t.me/mywebsite',
instagramUsername: '@mywebsite',
homeUrl: 'https://www.mywebsite.com'
})
};
fetch('https://admin.snagsolutions.io/api/websites', 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://admin.snagsolutions.io/api/websites",
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' => 'My New Website',
'organizationId' => '123e4567-e89b-12d3-a456-426614174001',
'adminWalletAddress' => [
'0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
'0x66f820a414680b5bcda5eeca5dea238543f42054'
],
'twitterUsername' => '@mywebsite',
'discordUrl' => 'https://discord.gg/mywebsite',
'telegramUrl' => 'https://t.me/mywebsite',
'instagramUsername' => '@mywebsite',
'homeUrl' => 'https://www.mywebsite.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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://admin.snagsolutions.io/api/websites"
payload := strings.NewReader("{\n \"name\": \"My New Website\",\n \"organizationId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"adminWalletAddress\": [\n \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"0x66f820a414680b5bcda5eeca5dea238543f42054\"\n ],\n \"twitterUsername\": \"@mywebsite\",\n \"discordUrl\": \"https://discord.gg/mywebsite\",\n \"telegramUrl\": \"https://t.me/mywebsite\",\n \"instagramUsername\": \"@mywebsite\",\n \"homeUrl\": \"https://www.mywebsite.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://admin.snagsolutions.io/api/websites")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My New Website\",\n \"organizationId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"adminWalletAddress\": [\n \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"0x66f820a414680b5bcda5eeca5dea238543f42054\"\n ],\n \"twitterUsername\": \"@mywebsite\",\n \"discordUrl\": \"https://discord.gg/mywebsite\",\n \"telegramUrl\": \"https://t.me/mywebsite\",\n \"instagramUsername\": \"@mywebsite\",\n \"homeUrl\": \"https://www.mywebsite.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://admin.snagsolutions.io/api/websites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My New Website\",\n \"organizationId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"adminWalletAddress\": [\n \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"0x66f820a414680b5bcda5eeca5dea238543f42054\"\n ],\n \"twitterUsername\": \"@mywebsite\",\n \"discordUrl\": \"https://discord.gg/mywebsite\",\n \"telegramUrl\": \"https://t.me/mywebsite\",\n \"instagramUsername\": \"@mywebsite\",\n \"homeUrl\": \"https://www.mywebsite.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "My Website"
}"Forbidden, Could not validate api key"{
"success": false,
"message": "Internal server error",
"debugInfo": "Stack trace or additional error details"
}Website
Create website
Creates a new website. adminWalletAddress can only be used when authenticating with an organization API key.
POST
/
api
/
websites
Create website
curl --request POST \
--url https://admin.snagsolutions.io/api/websites \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "My New Website",
"organizationId": "123e4567-e89b-12d3-a456-426614174001",
"adminWalletAddress": [
"0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"0x66f820a414680b5bcda5eeca5dea238543f42054"
],
"twitterUsername": "@mywebsite",
"discordUrl": "https://discord.gg/mywebsite",
"telegramUrl": "https://t.me/mywebsite",
"instagramUsername": "@mywebsite",
"homeUrl": "https://www.mywebsite.com"
}
'import requests
url = "https://admin.snagsolutions.io/api/websites"
payload = {
"name": "My New Website",
"organizationId": "123e4567-e89b-12d3-a456-426614174001",
"adminWalletAddress": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "0x66f820a414680b5bcda5eeca5dea238543f42054"],
"twitterUsername": "@mywebsite",
"discordUrl": "https://discord.gg/mywebsite",
"telegramUrl": "https://t.me/mywebsite",
"instagramUsername": "@mywebsite",
"homeUrl": "https://www.mywebsite.com"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My New Website',
organizationId: '123e4567-e89b-12d3-a456-426614174001',
adminWalletAddress: [
'0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
'0x66f820a414680b5bcda5eeca5dea238543f42054'
],
twitterUsername: '@mywebsite',
discordUrl: 'https://discord.gg/mywebsite',
telegramUrl: 'https://t.me/mywebsite',
instagramUsername: '@mywebsite',
homeUrl: 'https://www.mywebsite.com'
})
};
fetch('https://admin.snagsolutions.io/api/websites', 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://admin.snagsolutions.io/api/websites",
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' => 'My New Website',
'organizationId' => '123e4567-e89b-12d3-a456-426614174001',
'adminWalletAddress' => [
'0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
'0x66f820a414680b5bcda5eeca5dea238543f42054'
],
'twitterUsername' => '@mywebsite',
'discordUrl' => 'https://discord.gg/mywebsite',
'telegramUrl' => 'https://t.me/mywebsite',
'instagramUsername' => '@mywebsite',
'homeUrl' => 'https://www.mywebsite.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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://admin.snagsolutions.io/api/websites"
payload := strings.NewReader("{\n \"name\": \"My New Website\",\n \"organizationId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"adminWalletAddress\": [\n \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"0x66f820a414680b5bcda5eeca5dea238543f42054\"\n ],\n \"twitterUsername\": \"@mywebsite\",\n \"discordUrl\": \"https://discord.gg/mywebsite\",\n \"telegramUrl\": \"https://t.me/mywebsite\",\n \"instagramUsername\": \"@mywebsite\",\n \"homeUrl\": \"https://www.mywebsite.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://admin.snagsolutions.io/api/websites")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My New Website\",\n \"organizationId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"adminWalletAddress\": [\n \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"0x66f820a414680b5bcda5eeca5dea238543f42054\"\n ],\n \"twitterUsername\": \"@mywebsite\",\n \"discordUrl\": \"https://discord.gg/mywebsite\",\n \"telegramUrl\": \"https://t.me/mywebsite\",\n \"instagramUsername\": \"@mywebsite\",\n \"homeUrl\": \"https://www.mywebsite.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://admin.snagsolutions.io/api/websites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My New Website\",\n \"organizationId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"adminWalletAddress\": [\n \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"0x66f820a414680b5bcda5eeca5dea238543f42054\"\n ],\n \"twitterUsername\": \"@mywebsite\",\n \"discordUrl\": \"https://discord.gg/mywebsite\",\n \"telegramUrl\": \"https://t.me/mywebsite\",\n \"instagramUsername\": \"@mywebsite\",\n \"homeUrl\": \"https://www.mywebsite.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "My Website"
}"Forbidden, Could not validate api key"{
"success": false,
"message": "Internal server error",
"debugInfo": "Stack trace or additional error details"
}Authorizations
Body
application/json
Body
Schema for creating a new website
Name of the website
Example:
"My New Website"
Organization ID for which this website is being created
Minimum string length:
1Example:
"123e4567-e89b-12d3-a456-426614174001"
Optional admin wallet addresses to grant admin access on creation (organization API key only). Maximum 2.
Maximum array length:
2Example:
[
"0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"0x66f820a414680b5bcda5eeca5dea238543f42054"
]
Twitter username of the website account
Example:
"@mywebsite"
Discord URL of the website account
Example:
"https://discord.gg/mywebsite"
Telegram URL of the website account
Example:
"https://t.me/mywebsite"
Instagram username of the website account
Example:
"@mywebsite"
Home URL of the official website
Example:
"https://www.mywebsite.com"
Was this page helpful?
⌘I