Create an app
Description
Request a new app and sandbox app if needed.
POST https://impact.dots.eco/api/v1/app/add
Please check Headers and authorization.
Example body
{
"name": "Test app",
"company_id": 10,
"logo": "https://impact.dots.eco/sites/default/files/styles/medium/public/logo/logo_white%20%281%29.png",
"social_media_image": "https://impact.dots.eco/sites/default/files/logo/dots%20SM.jpg",
"description": "Awesome app.",
"download": {"title": "Download Now", "url": "https://impact.dots.eco"},
"share_title": "Join me in protecting the planet with [it_app:name]",
"share_body": "Check out my impact.",
"share_hashtag": "tag"
}
Parameters
name - required*, string max_length=255 - The name of the application.
company_id - required*, integer max_value=10^10 - The company id.
share_title - required*, string max_length=255 - Used as first line of share message and mail subject.
share_body - required*, string max_length=255 - Used as rest of share message and mail body.
logo - optional, string - URL to app logo.
social_media_image - optional, string - URL to social media image.
description - optional, string - Description of the app.
download - optional, object max_length={ url: 2048, title: 255 }, - CTA button's url title and url.
share_hashtag - optional, string max_length=255 - Used as hashtag added to Twitter and facebook share.
Example request
The minimal request that will work with a code-only club. The other clubs
curl --location --request POST 'https://impact.dots.eco/api/v1/app/add' \
--header 'Content-Type: application/json' \
--header 'auth-token: YOUR_AUTH_TOKEN' \
--data-raw '{
"name": "Test app",
"company_id": 10,
"share_title": "Join me in protecting the planet with [it_app:name]",
"share_body" : "Check out my impact."
}
Key/Value pairs response body
"name": [string]- The name of the Application."app_id": [string]- Application ID"sandbox_app": [string]- Is it a sandbox app ?"logo": [integer]"- Log Url"social_media_image": [string]- Social Media Image."description": [string]- Application Description"download": [json]- Json Data for Downloading Application"url": [string]- Application Download url"share_title": [string]- Share Title"share_body": [string]- Share Description"share_hashtag": [string]- Share Hashtag"autocreated_sandbox": [json]- Sandbox app created by default
Example response
success
{
"name": "Test app",
"app_id": "1111",
"company_id": 10,
"sandbox_app": false,
"logo": "https://impact.dots.eco/sites/default/files/styles/medium/public/logo/logo_white%20%281%29.png",
"social_media_image": "https://impact.dots.eco/sites/default/files/logo/dots%20SM.jpg",
"description": "Awesome app.",
"download": {"title": "Download Now", "url": ""},
"share_title": "Join me in protecting the planet with [it_app:name]",
"share_body": "Check out my impact.",
"share_hashtag": "tag",
"autocreated_sandbox": {
"name": "Test app - Sandbox",
"app_id": "1112",
"company_id": 10,
"sandbox_app": true,
"logo": "https://impact.dots.eco/sites/default/files/styles/medium/public/logo/logo_white%20%281%29.png",
"social_media_image": "https://impact.dots.eco/sites/default/files/logo/dots%20SM.jpg",
"description": "Awesome app.",
"download": {"title": "Download Now", "url": "https://impact.dots.eco"},
"share_title": "Join me in protecting the planet with [it_app:name]",
"share_body": "Check out my impact.",
"share_hashtag": "tag",
}
}
Possible error responses
Unprocessable Entity
{
"message": "You must provide a valid 'name' value to process."
}
Status:422 Unprocessable Entity
{
"message": "You must provide a valid 'company_id' value to process."
}
Status:422 Unprocessable Entity
{
"message": "You must provide a valid 'share_title' value to process."
}
Status:422 Unprocessable Entity
{
"message": "You must provide a valid 'logo' value to process."
}
Status:422 Unprocessable Entity
{
"message": "You must provide a valid 'social_media_image' value to process."
}
Status:422 Unprocessable Entity
{
"message": "You must provide a valid 'download' value to process."
}
Status:422 Unprocessable Entity
{
"message": "The maximum length of [field] is [max_length] characters."
}
Status:422 Unprocessable Entity
{
"message": "The maximum value of [field] is [max_length]."
}
Status:422 Unprocessable Entity
Access Denied
{
"message": "You must provide a valid 'download' value to process."
}
Status:403 Access Denied HttpException
{
"message": "You can send one request every 5 seconds."
}
Status:403 Access Denied HttpException
{
"message": "Too many requests. You can send one request every 5 seconds"
}
Status:403 Access Denied HttpException
{
"message": "Access denied: you dont have permissions to create an application."
}
Status:403 Access Denied HttpException