Get Started
In this guide, you are going to learn how to interact with sections as a frontend developer. If you are a vueJS dev you can use our ready made vue-sections library.
If you wish to create your own client implementation, keep reading.
Step 1: Register here to get your project_id
.
Step 2: With your project_id
you can start requesting sections yet to create pages and add content to them you need an access token. Read below to understand how to get an access token for your project.
Note: All requests that are secured by a Section token is subject to CORS verification
API's base URL is https://sections.geeks.solutions
Models
Dashboard
Dashboard information returned that conveys package limitations and current consumption
{
"package_name": "free",
"package_locked": false,
"max_pages": 2,
"max_media_files": 10,
"max_file_size": 500000,
"current_pages": 0,
"current_medias": 0,
"api_until_reset": 46674951,
"api_limit_use": 500,
"api_current_use": 0
}
Property | Description | Type | Required |
---|---|---|---|
api_current_use | current rate limtied requests ina specific day | boolean | true |
api_limit_use | Maximum allowed rate-limited requests in a specific day - Package limitation | string | true |
api_until_reset | Timestamp in milliseconds until the API rate-limited consumption is reset | integer | true |
current_medias | Count of total files currently present linked to pages of this project. | integer | true |
current_pages | Count of number of pages currently created in the project. | integer | true |
max_file_size | Maximum allowed file size (in bytes) that can be used in pages of this project - Package limitation. | integer | true |
max_media_files | Maximum allowed files that can be present linked to pages of this project - Package limitation. | integer | false |
max_pages | Maximmum number of pages that can be created in the project. - Package limitation | integer | true |
package_locked | The package's locked status the project is subscribed to. | boolean | true |
package_name | The package's name the project is subscribed to. | string | true |
Error
Errors returned by sections
{
"error": "Section type already exists"
}
Property | Description | Type | Required |
---|---|---|---|
error | Description of the error | string | false |
Invitation
This is the response of the invitation API call.
{
"invited": [
"email1@gmail.com",
"email2@gmail.com"
],
"failed_to_send": [
"email3@gmail.com"
],
"demotion": [
"superiorrole@gmail.com"
]
}
Property | Description | Type | Required |
---|---|---|---|
demotion | List of emails that are already in the project and have a superior role to the invitation one. | array(any) | false |
failed_to_send | List of failed invitation emails | array(any) | false |
invited | List of successfully invited emails | array(any) | false |
Media
A media is an entity that presents a file in Sections
{
"type": "image",
"seo_tag": "",
"private_status": "public",
"number_of_contents": 1,
"namespace": "608c0177d66ef2000836a374",
"locked_status": "unlocked",
"id": "613874bc0a998613c74b338c",
"files": [
{
"url": "https://s3.amazonaws.com/eweevtestbucketprivate/sections%2Fa5ac5bc7e6d643f89a4f15c4d8f29aec89ba3988ab904d6aae5934719d4df19a.png",
"type": "image/png",
"thumbnail_url": "https://s3.amazonaws.com/eweevtestbucketprivate/sections%2Fa5ac5bc7e6d643f89a4f15c4d8f29aec89ba3988ab904d6aae5934719d4df19a_thumbnail.png",
"size": 25442,
"platform_id": "611610df0a998615afb99c29",
"filename": "sections/a5ac5bc7e6d643f89a4f15c4d8f29aec89ba3988ab904d6aae5934719d4df19a.png",
"file_id": "ac411a0825cd280cc219844bf3b64271-12de37"
}
],
"contents_used": [
"60cb6953d66ef20008ae2177"
],
"author": "60cb6953d66ef20008ae2177"
}
Property | Description | Type | Required |
---|---|---|---|
author | The author of the media | string | false |
contents_used | List of pages related to this media | array(any) | false |
files | List of files | array(any) | true |
id | Unique identifier | string | true |
locked_status | unlocked media can be edited by any user in the project. locked medias can only be edited by their author |
string | false |
namespace | The project id using this media | string | false |
number_of_contents | The number of contents referencing this media | integer | false |
private_status | public files are accessible by anyone, private files requires an STS token to be viewed |
string | false |
seo_tag | Image Alt tag used for SEO | string | false |
type | Media type (image, video..) | string | false |
Message
A confirmation message back to the user upon successfull action
{
"message": "Section type deleted succesfully"
}
Property | Description | Type | Required |
---|---|---|---|
message | a message | string | false |
Options
Options returned by third party applications for a configurable section type
[
{
"option_values": [
1,
2,
3
],
"field": "article_ids"
}
]
Property | Description | Type | Required |
---|---|---|---|
error | Array of options with their possible values | array(any) | false |
Package
A package is the subscription of your project in section. It represents what the project is offered in term of resources.
{
"type": "public",
"rank": 1,
"quota": -1,
"price": 1700,
"name": "solo",
"locked": false,
"limits": [
{
"value": 5,
"name": "number_of_pages",
"label": "Max number of pages"
},
{
"value": 3,
"name": "variation_per_page",
"label": "Max number of variation per page"
},
{
"value": 20,
"name": "static_sections",
"label": "Max number of static section types that can be declared"
},
{
"value": 10,
"name": "sections_total",
"label": "Max number of sections per page"
},
{
"value": 100,
"name": "hosted_files",
"label": "Max number of files hosted"
},
{
"value": 1000000,
"name": "size_per_file",
"label": "Maximum Size Per File (in bytes)"
},
{
"value": -1,
"name": "api_limit_sec",
"label": "API rate limit per sec"
},
{
"value": -1,
"name": "api_limit_minute",
"label": "API rate limit per minute"
},
{
"value": 500,
"name": "api_limit_hour",
"label": "API rate limit per hour"
},
{
"value": 1000,
"name": "api_limit_day",
"label": "API rate limit per day"
}
],
"label": "Standard"
}
Property | Description | Type | Required |
---|---|---|---|
id | Unique identifier | string | true |
label | The title of the package | string | false |
limits | A list of limits, it shows up to how much resources can your project consume | array(any) | false |
locked | Whether this package is locked and can receive new subscriptions or not | boolean | false |
name | Unique name of the package | string | false |
price | The price of the package in cents (ie 10,50€ is returned as 1050) | integer | false |
quota | The number of projects allowed to use this package at any given time. -1 for unlimited | integer | false |
rank | The package rank used to identify upgrades/downgrades between packages | integer | false |
type | The type of the package could be private or a public one. | string | false |
Page
A page is layout of different sections grouped together.
{
"variations": [
"variation-1",
"variation-2"
],
"settings": [
{
"weight": 1,
"type": "dynamic",
"region": "bottom-left",
"name": "blogs:categories_articles",
"id": "123456789123456789123456"
}
],
"project_id": "5fe309f42a4e7d91aad8964f",
"page": "home_page",
"layout": "layout1"
}
Property | Description | Type | Required |
---|---|---|---|
id | Unique identifier | string | true |
layout | The layout title | string | false |
metadata | An object containing the metadata of your page | map | false |
page | Name of the page | string | true |
path | The path under your domain to access your page, it has to be unique per project. Equals to your page name if empty | string | true |
render_data | Data requested by the front end developer that he will use to render the content needed. | string | false |
settings | List of sections that are included in the page | array(any) | false |
variations | A variations for the page | string | false |
Pending_Invitation
This is the response of the get pending_invitation API call.
{
"users": [
{
"role": "webmaster",
"invited_at": 1652524584,
"email": "email@gmail.com"
}
],
"total": 1
}
Property | Description | Type | Required |
---|---|---|---|
total | Total of pending invitations | integer | false |
users | List of pending invitations | array(any) | false |
Project
A Project that a user owns in sections it contains the project credentials and configurations
{
"type": "private",
"project_url": [
"https://your.project.url.com"
],
"private_key": "xxxxxx",
"package": "free",
"login_redirect_url": "https://your.project.url.com/redirect_login/admin",
"id": "601bf1221907a50007ba3f81",
"files_counter": 0,
"configured_fields": {
"blogs ": {
"project_id": 1,
"private_key": "xxxxxx"
}
},
"active": true
}
Property | Description | Type | Required |
---|---|---|---|
active | The status of the project | boolean | false |
billing_status | The Billing status of the project, can be any of upgrade_lock or upgradeable . |
||
This is automatically set based on your company solvency status. | string | false | |
configured_fields | A list of object (maps) that indicates the configured fields of the third party apps for this project | array(any) | false |
id | Unique identifier | string | true |
limitation_status | The Limitation status of the project, can be any of active , degraded or blocked . |
||
This is automatically set based on your invoice payment status. | string | false | |
login_redirect_url | The URL Sections redirects connected user to with the auth code to issue a valid access token. | string | false |
package | The current subscription of the project | string | false |
project_url | The list of base URLs of the project, used to pass CORS. You are allowed to use localhost in the list, as long as you specify the port.Local network IP Addreses are also allowed, only on HTTP and by specifying the port as well. | array(any) | false |
reason | The reason of inactivity in case the project is inactive | string | false |
type | The type of the project can be public or private | string | false |
Section_Type
A Section Type in Sections
{
"type": "static",
"name": "private_static",
"multiple": false,
"id": "60195bbd2a4e7df7496d9740",
"fields": "null",
"dynamic_options": false,
"application": "sections",
"access": "private"
}
Property | Description | Type | Required |
---|---|---|---|
access | The access to the section type | string | false |
application | application that declared the section type | string | false |
authorization_fields | Used for third party integration to authorize the use who is asking for the section type | map | false |
fields | Used for configurable Section Types fields that can be chosen to render | map | false |
id | Unique identifier | string | true |
name | Section type's name | string | false |
options | Used for configurable Section Types options | map | false |
region | The region of the layout that section type will be rendered into default to {}. | map | false |
requirements | Shows the required fields for a public scoped section type. | array(any) | false |
status | Shows the status for a public scoped section type. | string | false |
type | The type of the sections i.e. static, local, configurable or dynamic | string | false |
weight | The weight of the section type on the layout which means the order | integer | false |
Token
Certain API calls are secured with an access token, read below about authentication to know how to get an access token for your application
{
"token": "A really long string"
}
Property | Description | Type | Required |
---|---|---|---|
token | An authentication token | string | false |
User
This is Section's user model. It contains all the information that sections needs to know about you.
{
"token": "A really long string"
}
Property | Description | Type | Required |
---|---|---|---|
Users email | string | false | |
roles | DEPRECATED. A list, contains the roles' IDS. | array(any) | false |
roles_object | A lsit of objects. Each object contains the role title and id. These are the roles that are assigned tot he user. | array(any) | false |
saas_project_id | The section project to which the user is linked to. | string | false |
1. Authentication
In order to issue secured api calls to sections you need an access token, to simplify the generation of such token we implemented a simple flow.
When you register or login successfully you will get redirected to the back office page of your project where you see your project information.
There is a field named Login Redirect Url
you should populate it with the URL of a page on your project where you will run the Access Token retrieval code.
Next to the field, there is a button called Connect to your app with your sections credentials
. When clicking this button you will get redirected to your website with an auth_code
in the query string. This auth code is required to retrieve your access token from sections in the Get Access Token request.
Once you retrieve your token you have to include it in :ratethe header of the secured requests.
Get access token
Valid auth code/
GET /api/v1/project/646cbbe288ac0f02e1ccf741/token/F41DEB5163C0CFF3F33E5EE9BBA9051B
origin: http://d416621d-6c3d-48f3-a490-c7bca5b67f3f.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEdXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmJlMjg4YWMwZjAyZTFjY2Y3NDFqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACA5YzUzOTg4M2Y3OWM0ZjhmYmUzYjQzYWNmMGE4Y2JmMm0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYASu29SIgBYgABUYA.uI-Tw29vnd2xtrKpmvtaLB40W0z1_v-g0ru5ziv3xfA
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH9B7oRvKQldEAA5ei
access-control-allow-origin: http://d416621d-6c3d-48f3-a490-c7bca5b67f3f.com
{
"token": "SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEdXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmJlMjg4YWMwZjAyZTFjY2Y3NDFqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACA5YzUzOTg4M2Y3OWM0ZjhmYmUzYjQzYWNmMGE4Y2JmMm0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYASu29SIgBYgABUYA.uI-Tw29vnd2xtrKpmvtaLB40W0z1_v-g0ru5ziv3xfA"
}
Use a supplied auth_code to retrieve an access token. The auth_code expires in a few seconds, if you wish to test that using an API client (i.e Postman) make sure to act quickly.
Request
GET api/v1/project/{project_id}/token/{auth_code}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
auth_code | An authentication code that will be returned on redirection when you login/register successfully | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | Token |
410 | Error Resource | Error |
2. Working With Pages
A page is where you organize your sections in one or more layouts. In this part you will learn how to create/update/render and delete a page. Please refer to the page models to see all fields a page can contain.
Renders a page
Get an existing page
POST /api/v1/project/646cbb6188ac0f02e191c2ee/page/page-path-a016d1b0-c39a-4c21-9371-328e8aa96340
origin: http://69e5a319-0e86-4a3e-8ebe-8154d9961d6a.com
user-agent: user-agent-1fbdacf5-ebf4-465b-a4d8-ce9515335733
project-id-71835fd5-e361-4347-87bb-3d0810834f35: 1
content-type: multipart/mixed; boundary=plug_conn_test
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH1jaGm8kOkFkAA4gD
access-control-allow-origin: http://69e5a319-0e86-4a3e-8ebe-8154d9961d6a.com
{
"variations": null,
"sections": [
{
"weight": 1,
"type": "static",
"settings": {},
"render_data": "",
"region": "main",
"name": "section_name_5e050612-e475-457d-b14a-523707dcf3ea",
"linked_to": "",
"id": "646cbb6288ac0f02e19a0b3f",
"error": null
}
],
"path": "page-path-a016d1b0-c39a-4c21-9371-328e8aa96340",
"page": "page_5071b0e6-a383-4428-8798-701771929cdb",
"metadata": {},
"layout": "layout1",
"last_updated": 1684847458,
"invalid_sections": [],
"id": "646cbb62223160f5dd68e4bf"
}
Renders a page with all the available sections declared inside.
Request
POST api/v1/project/{project_id}/page/{page_path}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
query_string | Query Strings | body | map | false | {id: 1} | |
project_id | Your project id in Sections | query_string | string | true | ||
page_path | The page path | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Project resource | Page |
404 | Error Resource | Error |
429 | Error Resource for rate limiting | Message |
Creates/updates a page
Create a page with valid section using medias ids
PUT /api/v1/project/646cbb7a88ac0f02e1b40a29/page/page_1bca67cf-d12a-442a-93fb-7a731107dcba
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI3YTg4YWMwZjAyZTFiNDBhMjlqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACBjNGIxNjI0OGYwYjY0NzNmOGIxMmIzZGJmOTdmNTEzN20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAA1a8SIgBYgABUYA.K944E6nkXBvTszj1UtKAsDkYFeHb-1X1PtZNKoSKGws
origin: http://6b501319-d25d-4e99-9e50-f9e2feb889f2.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"variations": [
"1"
],
"sections": [
{
"weight": 1,
"region": "main",
"options": [
{
"image": {
"media_id": "646cbb7e88ac0f02e1cc5516"
}
}
],
"name": "section_name_340bba3a-0ded-4aa4-8ad9-9cfcfae14802"
}
],
"path": "my-page-path",
"metadata": {
"title": "Page Title",
"description": "Page SEO Description"
},
"layout": "layout1"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH3PD9PTDl9-AABKOB
access-control-allow-origin: http://6b501319-d25d-4e99-9e50-f9e2feb889f2.com
{
"variations": [
"1"
],
"sections": [
{
"weight": 1,
"type": "static",
"settings": [
{
"image": {
"url": "https://www.fake-url.com/791c6a6716034266bf64db6c9a721cd7",
"media_id": "646cbb7e88ac0f02e1cc5516"
}
}
],
"render_data": "",
"region": "main",
"name": "section_name_340bba3a-0ded-4aa4-8ad9-9cfcfae14802",
"linked_to": "",
"id": "646cbb7f88ac0f02e13e94f7",
"error": null
}
],
"path": "my-page-path",
"page": "page_1bca67cf-d12a-442a-93fb-7a731107dcba",
"metadata": {
"title": "Page Title",
"description": "Page SEO Description"
},
"layout": "layout1",
"last_updated": 1684847487,
"invalid_sections": [],
"id": "646cbb7f223160f5dd68e804"
}
Upsert a page in your project with all the sections declared and their
configuration so when rendering the page the user gets the same result.
If you wish to create an empty page, simply supply an empty sections
list in the payload.
For each section you can provide options.
In the options you can add files for you to use. In order to add a file for a static section type.
You need to add the fields that declare files in that section type. For ex:
{
"fields": [
{
"type": "image",
"name": "profile_image"
},
{
"type": "image",
"name": "cover_image"
}
]
}
Now in the options you can provide an existing media id to link to a section on a page.
"options": [{"profile_image": {"media_id": "media_id"}}]
For More details on Medias
, please head to the Medias
section below.
DEPRECATED: you can also provide the image like that:
"options": [{"profile_image": "A BASE 64 file string"}]
The base64 will be transformed into a media file on the fly. This method will be dropped in an upcoming update.
Request
PUT api/v1/project/{project_id}/page/{page_name}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
page_name | The page name | query_string | string | true | ||
token | Sections Token | header | string | true | ||
variations | In case you need no Variations of the page send an empty list or null | body | array | true | {'variations': ['page1', 'page2']} | |
sections | List of sections that are going to be rendered in the page | body | array | true | {'sections': []} | |
layout | Layout title of the page | body | string | false | {'layout': 'main'} | |
url | Url of the page as the Path to access it (ie https://www.example.com/{url}) | body | string | true | {'url': 'my-page-url'} | |
metadata | Metadata of the page | body | map | false | {'metadata': {'title': 'My Page Title', 'description': 'SEO Description'}} |
Responses
Status | Description | Schema |
---|---|---|
200 | Project resource | Page |
401 | Error Resource | Error |
402 | Error Resource | Error |
Deletes a page
delete a page
DELETE /api/v1/project/646cbb7188ac0f02e1d85b13/page/646cbb71223160f5dd68e6d3
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI3MTg4YWMwZjAyZTFkODViMTNqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACBhYWFmMjg2Nzk4YzI0NDBhYmU1MDIzZmEyYjMxZDZiYW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAxTO8SIgBYgABUYA.HhNSE305DPXW36HLlWIWZBXEQQCg3U9jib1t7wdDniQ
origin: http://07bb64f6-f012-436e-b796-a74ff8d7801f.com
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH2dKT9e0szWQABJ-h
access-control-allow-origin: http://07bb64f6-f012-436e-b796-a74ff8d7801f.com
{
"message": "Successfully deleted 646cbb71223160f5dd68e6d3"
}
Deletes the page for your project. This call will erase all the data you have stored for the sections added in this particular page.
Request
DELETE api/v1/project/{project_id}/page/{page_id}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
page_id | The page id in Sections | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Project resource | Message |
401 | Error Resource | Error |
404 | Error Resource | Error |
3. Working With Section Types
### Sections supports four section types:
Local: This section type is totally declared and rendered on your frontend project. We have added support for such contents so you can blend it with the rest of section and define where in the page this content should display in between other sections. To add a local section to your page you just need to add a section object to your payload with type
local
and a name of your choice so you can then match it to the right content to render when you are to render the page to your visitor.Static: Static sections are supported out of the box. A static section is a very simple piece of content that provides a basic object storage for the frontend developer. This section can be used to store simple html, medias, DEPRECATED: images in base64 format (do not abuse it :-), or even JS/CSS code if you need to. This section is called static because from a server's perspective the content returned by this section is directly loaded from the Database with no processing, yet you can, as a frontend developer provide very dynamic end results by relying on external APIs at the javascript level (i.e facebook plugins, api request on frontend level etc...). You are just limited by your imagination here.
Dynamic: A dynamic section type is a bit more interesting as the content of such sections will be loaded dynamically server side. A dynamic section type will be declared by a backend third party and it will be called each time this section is requested for rendering.
Configurable: A configurable section is similar to a dynamic one as both have dynamic contents. The difference here is that a configurable section has options that the page editor can choose from. These options are stored in sections and provided to the third party server for rendering so you don't have to worry about that.
Accesses
Accesses to section types varies between:
Public is obviously public to anyone to use. So a public section type can be used by any user from any project. A section will be always declared private. However, only admins of sections can make a section type public. So you should ask them for that, they will review it and take action.
Private section type is only accessible by the project who declared the section type using his project_id and private key as mentioned in the
prerequisites
above. The project id and private key will be used to make sure that this private section type will only be accessible by the declarer’s project.Public scoped is a public section type that needs authorization to be used. It is accessible to anyone who is authorized to see it. So the project owner will need to pass authorization fields when rendering a public scoped section type in order to be granted the access for it. The authorization fields are per application level. So it only needs to be sent once (the first time). Then the application gains access if the authorization fields are valid.
Returns the list of section types the project owns
GET Section Types
GET /api/v1/project/646cbb6888ac0f02e1521620/section-types
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI2ODg4YWMwZjAyZTE1MjE2MjBqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACBiNzgwYTEwMGIwOWE0MDE1OWJkOGQyMjdkMjE4NDg5N20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAUxC8SIgBYgABUYA.YhTFN7meZnU8DI2uSNTFhstUWnOhR2cJwOBjhjUl-6s
origin: http://878476e8-945d-4e25-aaaa-be089d4464f5.com
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH16AjFrfTE2sAA4pC
access-control-allow-origin: http://878476e8-945d-4e25-aaaa-be089d4464f5.com
{
"data": [
{
"type": "static",
"name": "wysiwyg",
"multiple": false,
"id": "646cbb5e223160f5dd68e44a",
"fields": null,
"dynamic_options": false,
"application_id": null,
"application": "sections",
"access": "public"
},
{
"type": "dynamic",
"requirements": [
"private_key",
"project_id"
],
"query_string_keys": null,
"name": "646cbb6788ac0f02e13b0571:top_articles",
"multiple": false,
"id": "646cbb67223160f5dd68e59e",
"fields": [],
"dynamic_options": false,
"application_id": "646cbb6788ac0f02e13b0571",
"application": "646cbb6788ac0f02e13b0571",
"app_status": "disbaled",
"access": "public_scoped"
},
{
"type": "configurable",
"requirements": [
"private_key",
"project_id"
],
"query_string_keys": null,
"name": "646cbb6788ac0f02e13b0571:selective_articles",
"multiple": true,
"id": "646cbb67223160f5dd68e5a0",
"fields": [
{
"type": "integer",
"name": "articles_ids",
"key": "articles_ids"
}
],
"dynamic_options": true,
"application_id": "646cbb6788ac0f02e13b0571",
"application": "646cbb6788ac0f02e13b0571",
"app_status": "disbaled",
"access": "public_scoped"
}
]
}
Load all the section types the project has access to. This can be custom static section types, private section types or public ones exposed by other backend third party developers. For section types with public scoped access you can know their status and required fields in this call also the application id to which they belong. This is helpful for updating your security fields for the considered application.
Request
GET api/v1/project/{project_id}/section-types
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | List of section types resource | Section_Type |
401 | Error Resource | Error |
Creates a static section type
Create Static ST
POST /api/v1/project/646cbb6588ac0f02e1319122/section-types/section_name_08514787-8b1b-4571-a371-5fb88ba9b9d2
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI2NTg4YWMwZjAyZTEzMTkxMjJqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACAyMGMxZGZlMTZkMzI0ZjM3OWZhYmRmZjE3OWRlMWRjZm0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAogO8SIgBYgABUYA.nIZK6KIrw_yB32MRRUis-_m5-gBI6yQoLlaDisVLJ2s
origin: http://6dcd0e1a-10d4-465d-8630-ef66e5e11f8c.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"fields": [
{
"type": "image",
"name": "profile"
},
{
"type": "image",
"name": "profile1"
}
]
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH1t5z1ziJXMAAA5eD
access-control-allow-origin: http://6dcd0e1a-10d4-465d-8630-ef66e5e11f8c.com
{
"type": "static",
"name": "section_name_08514787-8b1b-4571-a371-5fb88ba9b9d2",
"multiple": false,
"id": "646cbb6588ac0f02e1319123",
"fields": [
{
"type": "image",
"name": "profile"
},
{
"type": "image",
"name": "profile1"
}
],
"dynamic_options": false,
"application_id": null,
"application": "sections",
"access": "private"
}
Declares a PRIVATE static section type for your project. Private sections are exclusive to only one project so these will only be visible by you.
Request
POST api/v1/project/{project_id}/section-types/{section_name}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
section_name | Section name | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | Section_Type |
400 | Error Resource | Error |
401 | Error Resource | Error |
402 | Error when you reach your package limitation | Error |
Update the authorization fields for the considered app on your project
Upsert authorization fields for an application
PUT /api/v1/project/646cbb6888ac0f02e1521622/authorization_fields/123456
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI2ODg4YWMwZjAyZTE1MjE2MjJqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACBhMTUzMjIwNThhYTY0NWYwODhiMDRkZTlkYjhlODEwOG0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYATRK8SIgBYgABUYA.tDuHER8h-bdeEK7ZbGmolesHG8aYPwYrBn0MHdMuz-k
origin: http://03594211-9dcb-4146-9a95-e4ffd318ec1b.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"authorization_fields": {
"project_id": 38,
"private_key": "private_key_hashed"
}
}
Response
404
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH175N2U3mNUoABJQh
access-control-allow-origin: http://03594211-9dcb-4146-9a95-e4ffd318ec1b.com
{
"options": {},
"message": "The app does not exist"
}
It verifies the authorization fields provided. If the fields are valid then the project's configured fields will be updated to include this app's credentials. These credentials will be used to render any public scoped section decalred by the third party app. In case the credentials become at some point invalid their status will be updated and it will need an update from the user. This call will let you retrieve the application id for any public scoped section.
Request
PUT api/v1/project/{project_id}/token/{application_id}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
application_id | The application's id in Sections | query_string | string | true | ||
authorization_fields | Authorization fields used to authenticate your request to third party services (only for public scoped section types) | body | map | true | {authorization_fields: {username: 'You', password: 'are awsome'} } |
Responses
Status | Description | Schema |
---|---|---|
200 | Project resource | Project |
410 | Error Resource | Error |
Renders the requested section's data
Render an existing ST
POST /api/v1/project/646cbb6488ac0f02e1bdd4a9/section/render
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI2NDg4YWMwZjAyZTFiZGQ0YTlqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACBmMDZlMTY0ZDE3YTI0MWJjOTkzNjA2NjRhZmFjMTY3Zm0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAPAC8SIgBYgABUYA.x3NK5Boevzwwntk4Ksh1-qMBUp4D_3nk-O-c0eIW9yo
origin: http://9f7b6500-99bd-4c41-bf29-44971f55f7c2.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"section": {
"weight": 1,
"name": "section_name_b927f004-4272-4a59-ba38-f8dd39de8bc3"
}
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH1sG3W3g7EtwAA4ci
access-control-allow-origin: http://9f7b6500-99bd-4c41-bf29-44971f55f7c2.com
{
"weight": 1,
"type": "static",
"settings": {},
"render_data": "",
"region": {},
"name": "section_name_b927f004-4272-4a59-ba38-f8dd39de8bc3",
"linked_to": "",
"id": "646cbb6488ac0f02e1bdd4ad",
"error": null
}
Renders the section's data for a preview. When rendering a public scoped section type and the request returns an unauthorized request error (status code 401). The section's status will be updated to invalid
. Then it will need the user's intervention to update his credentials for this section's application using this endpoint so the status gets adjusted again.
Request
POST api/v1/project/{project_id}/section/render
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
query_string | Query Strings | body | map | false | {id: 1} | |
section | A map containing the section name and its order (weight) in the page | body | map | true | {section: {name: '6038e54de3ba240007b07913:categories_articles', weight: '1'} } |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | Section_Type |
400 | Error Resource | Error |
401 | Error Resource | Error |
Gets a configurable section type's options
Returning the options of a configurable section type to Sections
GET /api/v1/project/646cbb6788ac0f02e13b0570/section/646cbb6788ac0f02e13b0571%3Aselective_articles/options
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI2Nzg4YWMwZjAyZTEzYjA1NzBqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACAwMjgyOTgwZTc5MjU0N2M4YTQyN2Y1NWQ3NzNkYjVlN20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAkwq8SIgBYgABUYA.a8u6o_weaZvwiHAT-clRp1xTtIgIKkaOT7lTc4UDejc
origin: http://7c3beb7f-b77c-4d21-8801-67f72b9baa9d.com
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH14Hbe9NyYDQAA4li
access-control-allow-origin: http://7c3beb7f-b77c-4d21-8801-67f72b9baa9d.com
[
{
"option_values": [
{
"title": "Article 1",
"id": 1
},
{
"title": "Article 2",
"id": 2
}
],
"field": "article_ids"
}
]
Gets a configurable section type's options from the third party application. This is used so the user can choose the options he wants in order to render the configurable section type customized to his needs.
Request
GET api/v1/project/{project_id}/section/{section_name}/options
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
section_name | Section name | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Options resource | Options |
400 | Error Resource | Error |
404 | Error Resource | Error |
Deletes a static section type
Delete Static ST
DELETE /api/v1/project/646cbb6188ac0f02e191c2e9/section-types/section_name_55957b0e-02dd-43ce-b60d-cd01ae3fca77
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI2MTg4YWMwZjAyZTE5MWMyZTlqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACAzOWFiOGNiYWExZDc0NzBiODY2NDkwMDlmYzFjMzYxN20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAIfO7SIgBYgABUYA.j0eqTWXlbzCPumnn8aJiYyZdW_kuG2gSX9TIUUu4d0M
origin: http://4ac17e44-450a-4ba9-a754-afa80a95876b.com
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH1gHIFS5chGgAA4Fj
access-control-allow-origin: http://4ac17e44-450a-4ba9-a754-afa80a95876b.com
{
"message": "Static Section was deleted successfully."
}
Deletes a static section type
Request
DELETE api/v1/project/{project_id}/section-types/{section_name}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
section_name | Section name | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | message resource | Message |
404 | Error Resource | Error |
4. Packages and API limits
To ensure a faire usage from all users and provide a stable quality of service we have two layers of limitations, the first one is based on the resources your project can use, the bigger the package the more resources you are allowed to use (i.e number of pages, number of static sections types etc...). Once you reach a limit, any tentative to cross this limit will return an error with code 402. The only way for you to overcome this is to free up some resources or to upgrade your package.
Then we also are capping the number of requests you can issue on a project, here again the package you are on will define your cap. The bigger the package the more API requests you will be authorized to submit. If you reach your limit, any further requests will error with code 429. These limits gets reset per time cycle, you can either wait for the cycle to reset your limit or you can upgrade your package to overcome this limit.
Read below to retrieve your project package with the details of the limits applying to it
Gets the current package of the project
GET a package by name and active package/
GET /api/v1/project/646cbc3388ac0f02e14cb698/active_package
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEdXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmMzMzg4YWMwZjAyZTE0Y2I2OThqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACA5MjYxNThlNGI5MTg0ZWM3OTY2MDA3ZGJhZTcxYWYyMW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAhiq_SIgBYgABUYA.uopKDYcV9prx0L7l0eaO-aaJdE6-jH56nRxbYBm3Lac
origin: http://e38e1d8a-d2e1-4f48-9aa4-175db4ff5c1a.com
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HIBwuBVk8uJw0ABL6B
access-control-allow-origin: http://e38e1d8a-d2e1-4f48-9aa4-175db4ff5c1a.com
{
"type": "public",
"rank": 0,
"quota": -1,
"price": 0,
"name": "free",
"locked": false,
"limits": [
{
"value": 0,
"name": "query_string_support"
},
{
"value": 2,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 5,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 10,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": -1,
"name": "api_limit_hour"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": 0,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 2,
"name": "domains"
}
],
"label": "Free",
"id": "646cbb5e88ac0f02e1c55d26"
}
This call will return the package name and associated limits for your project
Request
GET /api/v1/project/{project_id}/active_package
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Package Resource | Package |
Get available packages
GET all public packages
GET /api/v1/project/646cbc2988ac0f02e158909e/packages
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEdXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmMyOTg4YWMwZjAyZTE1ODkwOWVqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACA1Nzc5MjFlNTc3MTU0ZTU4YjQ5ZGMwNjE2OWI4M2E0ZW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYALwS_SIgBYgABUYA.oYPMJE5A_e-mpOwzESIKtNFhs7bwaksBEyGT9vLoFqE
origin: http://f526af4c-b3e3-43c9-86cc-15c6140322f6.com
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HIBK2a1I5FVlYAA6xj
access-control-allow-origin: http://f526af4c-b3e3-43c9-86cc-15c6140322f6.com
{
"total": 5,
"data": [
{
"type": "public",
"rank": 0,
"quota": -1,
"price": 0,
"name": "free",
"locked": false,
"limits": [
{
"value": 0,
"name": "query_string_support"
},
{
"value": 2,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 5,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 10,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": -1,
"name": "api_limit_hour"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": 0,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 2,
"name": "domains"
}
],
"label": "Free",
"id": "646cbb5e88ac0f02e1c55d26"
},
{
"type": "public",
"rank": 1,
"quota": -1,
"price": 2900,
"name": "solo",
"locked": false,
"limits": [
{
"value": 0,
"name": "query_string_support"
},
{
"value": 5,
"name": "number_of_pages"
},
{
"value": 2,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 10,
"name": "sections_total"
},
{
"value": 100,
"name": "hosted_files"
},
{
"value": 1000000,
"name": "size_per_file"
},
{
"value": -1,
"name": "api_limit_sec"
},
{
"value": -1,
"name": "api_limit_minute"
},
{
"value": 500,
"name": "api_limit_hour"
},
{
"value": 1000,
"name": "api_limit_day"
},
{
"value": 0,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 1,
"name": "domains"
}
],
"label": "Standard",
"id": "646cbb5e88ac0f02e1c55d27"
},
{
"type": "public",
"rank": 2,
"quota": 2,
"price": 14900,
"name": "corporate",
"locked": false,
"limits": [
{
"value": -1,
"unit_price": 150,
"name": "number_of_pages",
"included": 10
},
{
"value": -1,
"name": "query_string_support"
},
{
"value": 5,
"name": "variation_per_page"
},
{
"value": 20,
"name": "static_sections"
},
{
"value": 15,
"name": "sections_total"
},
{
"value": 300,
"name": "hosted_files"
},
{
"value": 2000000,
"name": "size_per_file"
},
{
"value": -1,
"name": "api_limit_sec"
},
{
"value": -1,
"name": "api_limit_minute"
},
{
"value": 3000,
"name": "api_limit_hour"
},
{
"value": 20000,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 5,
"name": "users"
},
{
"value": -1,
"unit_price": 1000,
"name": "domains",
"included": 3
}
],
"label": "Corporate",
"id": "646cbb5e88ac0f02e1c55d28"
},
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "package_by_id",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support"
},
{
"value": 2,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 10,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": 100,
"name": "api_limit_hour"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 5,
"name": "domains"
}
],
"label": "Free",
"id": "646cbc2888ac0f02e13a3a3e"
},
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "premium",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support"
},
{
"value": 20,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 7,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": -1,
"name": "api_limit_hour"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 5,
"name": "domains"
}
],
"label": "premium",
"id": "646cbc2988ac0f02e158909d"
}
]
}
This call will list all the public and private packages with their attached limits that your project can subscribe to. If you have specific needs requiring the customization of certains limits, contact us to build with you a custom private package. Note that locked package won't be returned here unless you it is the package you are already subscribed to. If you update your project from a locked package to another one, you won't be able to come back to the locked package.
Request
GET /api/v1/project/{project_id}/packages
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | List of package resource | Package |
5. User Management
This part will guide on how to manage your account on Sections.
Register through the API
Register user and project
POST /api/v1/register
origin: http://clientapp.com:3001
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEdXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmJjMzg4YWMwZjAyZTE0MzQ0ODRqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACAxOTZjZGE0YmI2OWM0ZjllOGExYWNhMTUzZDJiMDkzN20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAm3W9SIgBYgABUYA.IB41nEJzp9d9l1vdSU_X52KcV15XafCov9vKkqkEyPQ
content-type: multipart/mixed; boundary=plug_conn_test
{
"user": {
"terms_conditions": true,
"password": "password",
"full_name": "Fullname",
"email": "success@gmail.com"
},
"project": {
"title": "Your Project Title",
"project_url": [
"your.url.com"
],
"login_redirect_url": "https://your.url.com"
}
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH7PhjKUuOMZQABKih
access-control-allow-origin: http://clientapp.com:3001
{
"data": {
"user": {
"user_id": "123userid123",
"saas_project_id": [
{
"title": "Your Project Title",
"saas_project_id": "646cbbc488ac0f02e19e7adf",
"role": "admin"
}
],
"last_login": 1684847556,
"full_name": "Someone",
"email": "someoneb143094b36aa4876b60d69869f93cb63@eweev.com"
},
"token": {
"token": "this is a token"
},
"project": {
"updated_at": 1684847556,
"type": "private",
"title": "Your Project Title",
"reason": null,
"project_url": [
"your.url.com"
],
"private_key": "$2b$12$iBEJT6JbMkDUsiWdyb2bB.DKtp2NRVCYg.2s053CNsii6kWH9jt4.",
"package": "free",
"login_redirect_url": "https://your.url.com",
"limitation_status": "active",
"last_req_date": null,
"inserted_at": "2023-05-23",
"id": "646cbbc488ac0f02e19e7adf",
"files_counter": 0,
"configured_fields": {},
"billing_status": "upgrade_lock",
"active": true,
"__meta__": {
"state": "built",
"source": "project",
"schema": "Elixir.Sections.Section.Project",
"prefix": null,
"context": null
}
}
}
}
API Route to be able to register a new user, and create this user's new project.
We now support the ability to include multiple project URLs used to pass CORS, by passing
a list of valid URLS as the value of project_key
Request
POST api/v1/register
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project | Project Model. | body | map | true | {'active' => true,'configured_fields' => {'blogs' => {'private_key' => 'xxxxxx','project_id' => 1}},'files_counter' => 0,'id' => '601bf1221907a50007ba3f81','login_redirect_url' => 'https://your.project.url.com/redirect_login/admin','package' => 'free','private_key' => 'xxxxxx','project_url' => ['https://your.project.url.com'],'reason' => nil,'type' => 'private'} | |
user | User Model. | body | map | true | {email: 'your_new_email@gmail.com', password: 'new_pass', current_pass: 'current_pass'} } |
Responses
Status | Description | Schema |
---|---|---|
200 | User resource | User |
410 | Error Resource | Error |
Get the pending invitations to a project.
Invite user to project success - user exists
GET /api/v1/project/646cbbd488ac0f02e1e14d30/pending_invitations
origin: http://f2f103b1-3baa-4651-b2ca-5d41cd86b0eb.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAFYWRtaW5tAAAAD3NhYXNfcHJvamVjdF9pZG0AAAAYNjQ2Y2JiZDQ4OGFjMGYwMmUxZTE0ZDMwam0AAAAGc3RhdHVzbQAAAAh2ZXJpZmllZG0AAAAHdXNlcl9pZG0AAAAgMDM3YzA1ZWM2NjQxNGEwZmJkNzUyM2UxOGM4MjJkN2ZtAAAABnN0YXR1c20AAAAHc3VjY2Vzc24GAC-5vUiIAWIAAVGA.jtLmrrcdM0kWcWX4H-psSew84eBENswPmoLKbaRYl2Y
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH8QnLM-klxHEAA5UC
access-control-allow-origin: http://f2f103b1-3baa-4651-b2ca-5d41cd86b0eb.com
{
"users": [
{
"role": "webmaster",
"invited_at": 1684847573,
"email": "email@eweev.com"
}
],
"total": 1
}
Used to fetch pending invitation to (existing or non existing) user emails to join your project with a specific role.
Request
GET api/v1/project/:project_id/pending_invitations
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Pending Invitation Resource | Pending_Invitation |
401 | Error Resource | Error |
Get your user information.
get user based on token
GET /api/v1/project/646cbbc988ac0f02e1e917d1/user
origin: http://8eeec082-c71d-425f-a671-aa4a4fc1aa4b.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAJd2VibWFzdGVybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY0NmNiYmM5ODhhYzBmMDJlMWU5MTdkMWptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIGI4YjM4NGZmZjliNzQ3MmRiOTNhZmNlZDhiYzExZTdibQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgALjb1IiAFiAAFRgA.Fa0P5fhL22wnWNwW_dk2bwHXvOzjFQBaAFWiejuh204
{
"aspect": "body_params"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH7lFsrernmbwAA53D
access-control-allow-origin: http://8eeec082-c71d-425f-a671-aa4a4fc1aa4b.com
{
"token": null,
"status": null,
"roles": null,
"projects": [
{
"saas_project_id": "646cbbc988ac0f02e1e917d1",
"role": "admin"
}
],
"inserted_at": null,
"id": "1",
"full_name": "Full Name",
"email": "email@eweev.com"
}
Used to get your own user information based on the token.
Request
GET api/v1/project/:project_id/user
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com | |
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | User resource | User |
401 | Error Resource | Error |
Verify your Sections account
Verify user
POST /api/v1/verify_user
origin: http://clientapp.com:3001
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEdXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmJkMTg4YWMwZjAyZTFiY2Y5MzhqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACBmYjczOGI4YTg2OGI0ZTlkYjM2ZDE2ZTkxN2ZlN2M0N20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAjqy9SIgBYgABUYA.quGtDviymOo0IPAfhEfMJzX0tYweTI-l_TNU4ZuNX3s
content-type: multipart/mixed; boundary=plug_conn_test
{
"token": "this is the token"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH8DpeLx_tAhMAA55j
access-control-allow-origin: http://clientapp.com:3001
{
"message": "Your email has been successfully verified."
}
Used to verify your Sections account.
You are expected to use the token
received in the verification email as the token
authorization header.
Request
POST api/v1/verify_user
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com |
Responses
Status | Description | Schema |
---|---|---|
200 | Message resource | Message |
410 | Error Resource | Error |
Login through the API
login
POST /login
origin: http://clientapp.com:3001
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEdXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmJkZTg4YWMwZjAyZTExODBlYjlqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACA2ZTE1ZThmYTQzNmY0ZWFmYjkwMjM4ODU5MWNhYjkwMG0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAU969SIgBYgABUYA.T-bhSIvaz8mrvO27NLXtJBULVsmUAb8HeR7HpKCCnIk
content-type: multipart/mixed; boundary=plug_conn_test
{
"password": "password",
"email": "success@gmail.com"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH8zEx4mPYFQUAA5YC
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
x-download-options: noopen
x-permitted-cross-domain-policies: none
cross-origin-window-policy: deny
{
"token": {
"token": "this is a token"
},
"status": null,
"roles": null,
"projects": [
{
"title": null,
"saas_project_id": "646cbbde88ac0f02e1180eb9",
"role": "webmaster"
}
],
"inserted_at": null,
"id": "123userid123",
"full_name": "Someone",
"email": "someone4e12b3eb06334ba2a23fc003eff1e5b5@eweev.com"
}
API Route to be able to login and retrieve a user token, used for authorization.
The project_id
query parameter, alongside the project URL as the origin
header, are used to be able to pass CORS.
You can also use the encoded version of the project private key
to bypass CORS, and act as the project administrator.
Request
POST api/v1/login?project_id={PROJECT_ID}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com |
Responses
Status | Description | Schema |
---|---|---|
200 | User resource | User |
410 | Error Resource | Error |
Updates User
Update User
PUT /api/v1/project/646cbbe688ac0f02e1c988ed/user
origin: http://f6479f27-d45f-4dc2-b253-e49c159cd79f.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEdXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmJlNjg4YWMwZjAyZTFjOTg4ZWRqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACBiNjAyOWU0OWJlMDA0Zjc4YWExZTZjMTNjOTMwYmJkYW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAOf69SIgBYgABUYA.w3_ZvOm0Kf9RkWZD6pmlXajSMYsbW7mNj5WdOVdbc4s
content-type: multipart/mixed; boundary=plug_conn_test
{
"password": "new_password",
"full_name": "Your updated name",
"email": "new_email@eweev.com",
"current_password": "your_current_pass",
"confirm_password": "new_password"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH9RBpllEqhQEAA5jC
access-control-allow-origin: http://f6479f27-d45f-4dc2-b253-e49c159cd79f.com
{
"token": null,
"status": "pending",
"roles": null,
"projects": null,
"inserted_at": null,
"id": "b6029e49be004f78aa1e6c13c930bbda",
"full_name": "Your updated name",
"email": "new_email@eweev.com"
}
This call updates the user. Be careful when updating your email or password you need to supply you current password to authenticate your call under the field current_password
.
Request
PUT api/v1/project/{project_id}/user
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
token | Sections Token | header | string | true | ||
user | User Model. | body | map | true | {email: 'your_new_email@gmail.com', password: 'new_pass', current_pass: 'current_pass'} } |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | User |
400 | section type resource | Error |
410 | Error Resource | Error |
Add a User
Add a user to a project
PUT /api/v1/project/646cbbea88ac0f02e1b40ada/add_user
origin: http://afd0a5bc-4879-49be-85cd-0516804ad7f0.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEdXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmJlYTg4YWMwZjAyZTFiNDBhZGFqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACAyMzk5N2Q4YjUwNGQ0YTQ4YTlmNTc3YjY4ZjkzMjU2M20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAnw6-SIgBYgABUYA.Aqm2dQ_W7YWau8bc1Ci66zUuTF1e9q76AnAA6HbCkEw
content-type: multipart/mixed; boundary=plug_conn_test
{
"saas_project_id": "646cbbea88ac0f02e1b40ada",
"role": "User",
"email": "USER_EMAIL@gmail.com"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH9gqiViBE7NwABLCh
access-control-allow-origin: http://afd0a5bc-4879-49be-85cd-0516804ad7f0.com
{
"token": null,
"status": null,
"roles": null,
"projects": [
{
"saas_project_id": "646cbbea88ac0f02e1b40ada",
"role": "User",
"accepted_on": 1684847595
}
],
"inserted_at": null,
"id": "7dbd5726-9c90-4557-89d4-98eb3b106a2c",
"full_name": null,
"email": null
}
This call adds the user, of the given email, to a project you are an admin on.
Request
PUT api/v1/project/{project_id}/add_user
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
token | Sections Token | header | string | true | ||
user | User Model. | body | map | true | [123,10,32,32,32,32,32,32,34,115,97,97,115,95,112,114,111,106,101,99,116,95,105,100,34,58,32,34,54,48,100,97,101,49,97,49,48,97,57,57,56,54,50,99,50,97,55,48,97,98,49,49,34,44,10,32,32,32,32,32,32,34,114,111,108,101,34,58,32,34,85,115,101,114,34,44,10,32,32,32,32,32,32,34,101,109,97,105,108,34,58,32,34,97,46,115,97,114,107,105,115,43,98,108,111,103,49,48,48,64,101,119,101,101,118,46,99,111,109,34,10,32,32,32,32,125] |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | User |
400 | section type resource | Error |
401 | Error Resource | Error |
404 | section type resource | Error |
Invite a user to join your project
Invite user to project success - user exists
POST /api/v1/project/646cbbd488ac0f02e1e14d30/invite_user
origin: http://f2f103b1-3baa-4651-b2ca-5d41cd86b0eb.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAFYWRtaW5tAAAAD3NhYXNfcHJvamVjdF9pZG0AAAAYNjQ2Y2JiZDQ4OGFjMGYwMmUxZTE0ZDMwam0AAAAGc3RhdHVzbQAAAAh2ZXJpZmllZG0AAAAHdXNlcl9pZG0AAAAgMDM3YzA1ZWM2NjQxNGEwZmJkNzUyM2UxOGM4MjJkN2ZtAAAABnN0YXR1c20AAAAHc3VjY2Vzc24GAC-5vUiIAWIAAVGA.jtLmrrcdM0kWcWX4H-psSew84eBENswPmoLKbaRYl2Y
content-type: multipart/mixed; boundary=plug_conn_test
{
"invitation_user_email": [
"email@eweev.com"
],
"invitation_role": "webmaster"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH8PL6pmwlxHEABKsh
access-control-allow-origin: http://f2f103b1-3baa-4651-b2ca-5d41cd86b0eb.com
{
"invited": [
"email@eweev.com"
],
"invalid_format": [],
"failed_to_send": [],
"demotion": []
}
Used to send an invitation to (existing or non existing) user emails to join your project with a specific role.
Request
POST api/v1/project/:project_id/invite_user
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
invitation_role | The role to invite the users as | body | string | true | one of:webmaster,admin | |
invitation_emails | List of emails to invite to the project | body | array | true | ['email1@gmail.com','email2@gmail.com'] |
Responses
Status | Description | Schema |
---|---|---|
200 | Invitation Resource | Invitation |
401 | Error Resource | Error |
Accept an invitation to join a project.
Accept invitation to project success - user exists
POST /api/v1/invitation/accept_invitation
origin: http://42555385-ba56-4772-a1e0-68ba91671d2c.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEdXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmJjNDg4YWMwZjAyZTE5ZTdhZTBqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACAzZDcxMGRmNmZjMWY0ODUxYTQ1OGZkMTQ0MWE3MjgxZm0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAvHq9SIgBYgABUYA.kHV-VGOJBfAQfdHxmMY8vpcBCa5_Vg2HTqvVjdfGl6s
content-type: multipart/mixed; boundary=plug_conn_test
{
"invitation_token": "SFMyNTY.g2gDdAAAAANtAAAACnByb2plY3RfaWRtAAAAGDY0NmNiYmM0ODhhYzBmMDJlMTllN2FlMG0AAAAEcm9sZW0AAAAJd2VibWFzdGVybQAAAAp1c2VyX2VtYWlsbQAAABBlbWFpbDFAZW1haWwuY29tbgYA2Hu9SIgBYgABUYA.IUu_hgFbi0GO1bp7E__K5FNfOzUCuSz73UooTdlXiLU"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH7UuaQvL1Ew8ABKjB
{
"token": null,
"status": null,
"roles": null,
"projects": [
{
"title": null,
"saas_project_id": "646cbbc488ac0f02e19e7ae0",
"role": "webmaster"
}
],
"inserted_at": null,
"id": "56140ca1c9394b7f8778e9062c966583",
"full_name": "Full name",
"email": "email1@email.com"
}
Used to accept an invitation to join a project with a specific role.
You are expected to add the token
received in the email as the token
authorization header.
Request
POST /api/v1/invitation
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | User Resource | User |
401 | Error Resource | Error |
Cancel an invitation
Accept invitation to project failure - invitation cancelled
DELETE /api/v1/project/646cbbca88ac0f02e11d1d0a/cancel_invitation
origin: http://3d841f75-2a7e-42f6-a66d-6a8cc4954e21.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAFYWRtaW5tAAAAD3NhYXNfcHJvamVjdF9pZG0AAAAYNjQ2Y2JiY2E4OGFjMGYwMmUxMWQxZDBham0AAAAGc3RhdHVzbQAAAAh2ZXJpZmllZG0AAAAHdXNlcl9pZG0AAAAgMmM5MWI2MTBjYzk0NGQ2MDkzOTA4NjQ1MzZkMDE2ZWRtAAAABnN0YXR1c20AAAAHc3VjY2Vzc24GAIiRvUiIAWIAAVGA.DOLCSSFczWqXvWq1aZIx6CoVKxAIlzvRbMsIexVHOdQ
content-type: multipart/mixed; boundary=plug_conn_test
{
"invitation_user_email": "email1@email.com"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH7q2dp_vJ0p4AA5Mi
access-control-allow-origin: http://3d841f75-2a7e-42f6-a66d-6a8cc4954e21.com
{
"message": "Invitation cancelled successfuly"
}
Used to cancel invitations sent to specific emails.
Request
DELETE api/v1/project/:project_id/cancel_invitation
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
invitation_email | Email to cancel invitation to the project | body | string | true | 'email1@gmail.com','email2@gmail.com' |
Responses
Status | Description | Schema |
---|---|---|
200 | Message Resource | Message |
401 | Error Resource | Error |
6. Medias
This part is dedicated to give you a clear idea on how to manage your medias. A media is an entity that holds a file that can be used across multiple sections. We can create a media using a base64 file. You are limited to the number of medias and the size of each media file based on your subscription.
Creates a media
Create a page with valid section using medias ids then keep sync
POST /api/v1/project/646cbb6388ac0f02e19f2f05/media
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI2Mzg4YWMwZjAyZTE5ZjJmMDVqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACA5YmZhY2EyZmRiNjE0N2M5YWI2NmEwMWY3MzQ4NDc0M20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYADv27SIgBYgABUYA.UItHtVwQRw9qWlxPPNS4LV7jZD9mKmWPh6pAi3Ddf-0
origin: http://f06e7fa6-e54a-42da-bcd4-ae342fce078c.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"type": "image",
"private_status": "public",
"locked_status": "unlocked",
"files": {
"1": {
"file": {
"path": "test/support/toggle.png",
"filename": "blue.svg",
"content_type": "image/svg"
}
}
}
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH1noey9BhY7IAA49j
access-control-allow-origin: http://f06e7fa6-e54a-42da-bcd4-ae342fce078c.com
{
"type": "image",
"title": null,
"tags": null,
"seo_tag": null,
"private_status": "public",
"number_of_contents": 0,
"namespace": "646cbb6388ac0f02e19f2f05",
"meta": {},
"locked_status": "unlocked",
"id": "646cbb6888ac0f02e152161c",
"files": [
{
"url": "https://www.fake-url.com/3376c1f83abf4f6bbe9ed6ee18020440",
"type": "image/svg",
"thumbnail_url": "https://www.fake-url.com/801638ff5cdb42e4814b487500ee81a3",
"size": 3949,
"platform_id": "611696250a998650895fdf2f",
"metadata": {
"width": 80,
"height": 80
},
"filename": "fake_filename",
"file_id": "fake_file_id"
}
],
"creation_date": "2023-05-23",
"author": "9bfaca2fdb6147c9ab66a01f73484743"
}
Creates a media with a given file
Request
POST api/v1/project/{project_id}/media
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
id | The media id | query_string | string | true | ||
section | A map containing the file | body | map | true | {1: {file: 'BASE64_STRING_HERE', base64: true}} |
Responses
Status | Description | Schema |
---|---|---|
200 | Media resource | Media |
400 | Error Resource | Error |
404 | Error Resource | Error |
Renders a media
Create a page with valid section using medias ids then keep sync
GET /api/v1/project/646cbb6388ac0f02e19f2f05/media/646cbb6888ac0f02e152161c
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI2Mzg4YWMwZjAyZTE5ZjJmMDVqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACA5YmZhY2EyZmRiNjE0N2M5YWI2NmEwMWY3MzQ4NDc0M20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYADv27SIgBYgABUYA.UItHtVwQRw9qWlxPPNS4LV7jZD9mKmWPh6pAi3Ddf-0
origin: http://f06e7fa6-e54a-42da-bcd4-ae342fce078c.com
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH156ayolhY7IABJLB
access-control-allow-origin: http://f06e7fa6-e54a-42da-bcd4-ae342fce078c.com
{
"type": "image",
"title": null,
"tags": null,
"seo_tag": null,
"private_status": "public",
"number_of_contents": 0,
"namespace": "646cbb6388ac0f02e19f2f05",
"meta": {
"content": [],
"author": "deleted_user"
},
"locked_status": "unlocked",
"id": "646cbb6888ac0f02e152161c",
"files": [
{
"url": "https://www.fake-url.com/3376c1f83abf4f6bbe9ed6ee18020440",
"type": "image/svg",
"thumbnail_url": "https://www.fake-url.com/801638ff5cdb42e4814b487500ee81a3",
"size": 3949,
"platform_id": "611696250a998650895fdf2f",
"platform": {
"width": 1000,
"updated_at": 1628870181,
"number_of_medias": 0,
"namespace": "sections_app",
"name": "Global Platform",
"inserted_at": 1628870181,
"id": "611696250a998650895fdf2f",
"height": 1000,
"description": "This is the only platform used for sections"
},
"metadata": {
"width": 80,
"height": 80
},
"filename": "fake_filename",
"file_id": "fake_file_id"
}
],
"creation_date": 1684847464,
"author": "9bfaca2fdb6147c9ab66a01f73484743"
}
Renders the media with its details.
Request
GET api/v1/project/{project_id}/media/{id}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
id | The media id | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Media resource | Media |
400 | Error Resource | Error |
404 | Error Resource | Error |
Renders all medias for this project.
List medias
POST /api/v1/project/646cbb8288ac0f02e16541a1/medias
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI4Mjg4YWMwZjAyZTE2NTQxYTFqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACA1NDAxMjNkYzc5YTY0ODE0YmU4MmMzZjYwNDEwN2NhYW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAz3S8SIgBYgABUYA.ZmJYqKAdJKkP-QlGeAmhoazBpt3OsyFDgbgMrwLr9Qc
origin: http://6e77538f-6189-4df7-8540-4eb6466a11ad.com
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH3quFSVOnn1wABKQB
access-control-allow-origin: http://6e77538f-6189-4df7-8540-4eb6466a11ad.com
{
"total": 1,
"result": [
{
"type": "image",
"title": null,
"tags": null,
"seo_tag": null,
"private_status": "public",
"number_of_contents": 0,
"namespace": "646cbb8288ac0f02e16541a1",
"meta": {},
"locked_status": "unlocked",
"id": "646cbb8688ac0f02e1272299",
"files": [
{
"url": "https://www.fake-url.com/0ee8eeca3d8c493eba897d96b1e77fe6",
"type": "image/svg",
"thumbnail_url": "https://www.fake-url.com/dfb80f285fbd4b0d90eb21381c933123",
"size": 3949,
"platform_id": "611696250a998650895fdf2f",
"platform": {
"width": 1000,
"updated_at": 1628870181,
"number_of_medias": 0,
"namespace": "sections_app",
"name": "Global Platform",
"inserted_at": 1628870181,
"id": "611696250a998650895fdf2f",
"height": 1000,
"description": "This is the only platform used for sections"
},
"metadata": {
"width": 80,
"height": 80
},
"filename": "fake_filename",
"file_id": "fake_file_id"
}
],
"creation_date": 1684847494,
"author": "540123dc79a64814be82c3f604107caa"
}
]
}
Renders the medias with their details.
Request
POST api/v1/project/{project_id}/medias
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Array of Media resource | Media |
Updates a media
Create a page with valid section using medias ids then keep sync
PUT /api/v1/project/646cbb6388ac0f02e19f2f05/media/646cbb6888ac0f02e152161c
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbGQAA25pbG0AAAAPc2Fhc19wcm9qZWN0X2lkbAAAAAF0AAAAAm0AAAAEcm9sZW0AAAAEVXNlcm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NDZjYmI2Mzg4YWMwZjAyZTE5ZjJmMDVqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACA5YmZhY2EyZmRiNjE0N2M5YWI2NmEwMWY3MzQ4NDc0M20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYADv27SIgBYgABUYA.UItHtVwQRw9qWlxPPNS4LV7jZD9mKmWPh6pAi3Ddf-0
origin: http://f06e7fa6-e54a-42da-bcd4-ae342fce078c.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"type": "image",
"private_status": "public",
"locked_status": "unlocked",
"files": {
"1": {
"file": {
"path": "test/support/toggle.png",
"filename": "blue.svg",
"content_type": "image/svg"
}
}
}
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH2HsAdHVhY7IAA5rj
access-control-allow-origin: http://f06e7fa6-e54a-42da-bcd4-ae342fce078c.com
{
"type": "image",
"title": null,
"tags": null,
"seo_tag": null,
"private_status": "public",
"number_of_contents": 0,
"namespace": "646cbb6388ac0f02e19f2f05",
"meta": {},
"locked_status": "unlocked",
"id": "646cbb6888ac0f02e152161c",
"files": [
{
"url": "https://www.fake-url.com/5cc1e29f5d324e0891d0f6be04e35660",
"type": "image/svg",
"thumbnail_url": "https://www.fake-url.com/b2101c9af18e4b77a9c63948988e7dec",
"size": 3949,
"platform_id": "611696250a998650895fdf2f",
"metadata": {
"width": 80,
"height": 80
},
"filename": "fake_filename",
"file_id": "fake_file_id"
}
],
"creation_date": "2023-05-23",
"author": "9bfaca2fdb6147c9ab66a01f73484743"
}
Updates a media with a given file
Request
POST api/v1/project/{project_id}/media/{id}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
id | The media id | query_string | string | true | ||
section | A map containing the file | body | map | true | {1: {file: 'BASE64_STRING_HERE', base64: true}} |
Responses
Status | Description | Schema |
---|---|---|
200 | Media resource | Media |
400 | Error Resource | Error |
404 | Error Resource | Error |
7. Project Management
This part will guide on how to manage your project on Sections.
Update a project
Update project
PUT /api/v1/project/646cbb6888ac0f02e152161e
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACBkNTYxZmRmMTlhYTI0OGQ2OWI1NjQ5YzNlNzQxOGIyNW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYArw68SIgBYgABUYA.OvGuh7kecUDRE2XBsJ4Bidt7ciNlFaO_-MF8V0iUClw
pkey: $2b$12$k7rAG9nx4DCPIQOoDq93x.fzpkj3pYWHhEsqQu0dDbbALnv0UH21.
content-type: multipart/mixed; boundary=plug_conn_test
{
"title": "New title 123"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH16dgerWWhT8ABJMh
{
"updated_at": 1684847465,
"type": "private",
"title": "New title 123",
"reason": null,
"project_url": [
"http://localhost:3000",
"f0ad923e-b18d-455d-88fc-b8ffbe5b6052.com"
],
"private_key": "$2b$12$eNALOTLIJDt3GhhQo2/vE.JYyEywm5WgEz8813yBVOKJh03mnR8YS",
"package": "free",
"login_redirect_url": "http://localhost:3000/redirect-login",
"limitation_status": "active",
"last_req_date": null,
"inserted_at": "2023-05-23",
"id": "646cbb6888ac0f02e152161e",
"files_counter": 0,
"configured_fields": {},
"billing_status": "upgrade_lock",
"active": true,
"__meta__": {
"state": "built",
"source": "project",
"schema": "Elixir.Sections.Section.Project",
"prefix": null,
"context": null
}
}
Used to update any project field.
Notes:
- For the project_url
and login_redirect_url
fields, you can specify any of the following patterns for local testing:
- localhost:PORT with HTTP:// or HTTPS://
- Class A,B,C Private addresses with HTTP://
Request
PUT api/v1/project/:project_id/
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com | |
project | Project Model. | body | map | true | {'active' => true,'configured_fields' => {'blogs' => {'private_key' => 'xxxxxx','project_id' => 1}},'files_counter' => 0,'id' => '601bf1221907a50007ba3f81','login_redirect_url' => 'https://your.project.url.com/redirect_login/admin','package' => 'free','private_key' => 'xxxxxx','project_url' => ['https://your.project.url.com'],'reason' => nil,'type' => 'private'} |
Responses
Status | Description | Schema |
---|---|---|
200 | Project Resource | Project |
400 | Error Resource | Error |
Reset a Project's private key
Reset project private key
PUT /api/v1/project/646cbb6d88ac0f02e1a4f2a4/reset_key
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACAyYzYwZGY2ZjNlNDI0ZWNmOThkNzBiMTQ5M2QwYWQ5ZW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAXCS8SIgBYgABUYA.f9fnBzGeL7gr7SlQQhHOh0pmRypKcSHX0vhSB3VT_sc
pkey: $2b$12$0yPKHM2u2g44BopSwiGAt./AGbe6IdK/L8uz.ggpXbh4T0UFkH3Ay
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH2O3HBV09d2QABJ8B
{
"message": "Your project private key was successfully reset. The old one does not work anymore. Make sure to update the private key to the new one wherever you are using it."
}
Used to reset the private key field of a project.
Request
PUT api/v1/project/:project_id/reset_key
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com |
Responses
Status | Description | Schema |
---|---|---|
200 | Project Resource | Project |
400 | Error Resource | Error |
Get a project's dahsboard metrics
Get project dashboard
GET /api/v1/project/646cbb6a88ac0f02e13410a9/dashboard
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACBkYjg3NTk2ZmJkNjA0MWFjOTJkN2M2Njc2Mzg2NWM1YW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYABhe8SIgBYgABUYA.6qPdCrqr5KQwxdvKrahCPVWZzrIk8ECVXL0lTELt03o
pkey: $2b$12$MdPc/3I7ZgU/IJd5Ynt4Xe7tpi463HVR2alEFkMQ32qgWlm6q5Iqe
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH2CKM2Tk16iMAA5hj
{
"package_name": "free",
"package_locked": false,
"max_pages": 2,
"max_media_files": 10,
"max_file_size": 500000,
"current_pages": 0,
"current_medias": 0,
"api_until_reset": 38932831,
"api_limit_use": 500,
"api_current_use": 0
}
Used to retrieve a project's dashboard metrics such as package limitations and current usage.
Request
GET api/v1/project/:project_id/dashboard
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com | |
project | Project Model. | body | map | true | {'active' => true,'configured_fields' => {'blogs' => {'private_key' => 'xxxxxx','project_id' => 1}},'files_counter' => 0,'id' => '601bf1221907a50007ba3f81','login_redirect_url' => 'https://your.project.url.com/redirect_login/admin','package' => 'free','private_key' => 'xxxxxx','project_url' => ['https://your.project.url.com'],'reason' => nil,'type' => 'private'} |
Responses
Status | Description | Schema |
---|---|---|
200 | Dashboard Resource | Dashboard |
400 | Error Resource | Error |
8. Sections Admin Only Access
This part wil guide Sections Admins on actions they only can perform.
Get projects
test pagination and filtering of projects GET /api/v1/auth/project pagination limit and start
GET /api/v1/auth/project?start=1&limit=1
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACA3ZWZkMmEwNTM0OTQ0MWYwODk0YzkxNWUyN2FhN2I3Y20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAYk--SIgBYgABUYA.Fbs478vSunKKXqTG99vU-U0XCM2NcNsLrh73z_8cJw8
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HH-gg5xIK9PUQAA5wi
access-control-allow-origin: http://clientapp.com:3001
{
"total": 104,
"public_packages": [
{
"value": "Free",
"key": "free"
},
{
"value": "Standard",
"key": "solo"
},
{
"value": "Corporate",
"key": "corporate"
}
],
"data": [
{
"updated_at": 1684847457,
"type": "private",
"title": null,
"reason": null,
"project_url": [
"143329f4-bc66-44dd-80c3-630774181a23.com"
],
"private_packages": [],
"package": "free",
"login_redirect_url": "https://143329f4-bc66-44dd-80c3-630774181a23.com/redirect-login",
"limitation_status": "active",
"last_request_user": {
"role": "Server Request",
"full_name": "Server Request",
"email": "Server Request"
},
"last_req_date": 1684847457,
"inserted_at": 1684847456,
"id": "646cbb6088ac0f02e176a1a6",
"files_counter": 0,
"configured_fields": {},
"billing_status": "upgrade_lock",
"active": true,
"__meta__": {
"state": "built",
"source": "project",
"schema": "Elixir.Sections.Section.Project",
"prefix": null,
"context": null
}
}
]
}
Used to retrieve list of projects. Current supported filters are:
earliest_last_req_date: Timestamp of last_req_date as the earliest, ex:
1684847447
latest_last_req_date: Timestamp of last_req_date as the latest, ex:
1684847447
package: package name that the project subscribed to, ex:
corporate
project_url: project that has this project_url in his list, ex:
https://your.project.url.com
id: project id, ex:
628cbb71e537f4000619c0b7
full_name: last request user full name, ex:
User Full Name
email: last request user email, ex: `some_email@gmail.com
Request
POST api/v1/auth/projects
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | List of Project Resource | Project |
400 | Error Resource | Error |
Create a new package
create a package and create and existing package
POST /api/v1/auth/package
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACA5ZWFjZTUyODFjMWI0ZjAxODg5MDFkOWVkMzI1MWZiZW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYA_xm_SIgBYgABUYA.0fshDL1-3UI-TjjMJUAPyK1g6AiGJnasPWWzfV9JkDc
origin: http://ce5299b8-1489-458c-843f-3f6fbd541a38.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "new_name",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support",
"label": "label"
},
{
"value": 2,
"name": "number_of_pages",
"label": "label"
},
{
"value": 1,
"name": "variation_per_page",
"label": "label"
},
{
"value": 10,
"name": "static_sections",
"label": "label"
},
{
"value": 5,
"name": "sections_total",
"label": "label"
},
{
"value": 10,
"name": "hosted_files",
"label": "label"
},
{
"value": 500000,
"name": "size_per_file",
"label": "label"
},
{
"value": 10,
"name": "api_limit_sec",
"label": "label"
},
{
"value": 100,
"name": "api_limit_minute",
"label": "label"
},
{
"value": 100,
"name": "api_limit_hour",
"label": "label"
},
{
"value": 500,
"name": "api_limit_day",
"label": "label"
},
{
"value": -1,
"name": "dynamic_section_types_support",
"label": "label"
},
{
"value": 2,
"name": "users",
"label": "label"
},
{
"value": 5,
"name": "domains",
"label": "label"
}
],
"label": "Free"
}
Response
400
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HIBhnB92ZH8rkABLwh
access-control-allow-origin: http://clientapp.com:3001
{
"message": "Packages already exist"
}
Used to create a package
Request
POST api/v1/auth/package
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Package Resource | Package |
400 | Error Resource | Error |
Get package by id
Get package by ID
GET /api/v1/auth/package/646cbc2888ac0f02e13a3a3e
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACAyNjg5N2VhZWUxYjM0MTU2ODZjZmQzNzIyNmY4MDY3YW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAy_2-SIgBYgABUYA.ArL15iPLw41oXEP5aK1D3FIs0ikCTRhogK_6qgDQNwg
origin: http://0818d793-4e80-4618-baa2-45850734658c.com
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HIBGsMeX05tesAA6wD
access-control-allow-origin: http://clientapp.com:3001
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "package_by_id",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support"
},
{
"value": 2,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 10,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": 100,
"name": "api_limit_hour"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 5,
"name": "domains"
}
],
"label": "Free",
"id": "646cbc2888ac0f02e13a3a3e"
}
Used to retrieve a package by its id.
Request
GET api/v1/auth/package/:id
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Package Resource | Package |
400 | Error Resource | Error |
404 | Error Resource | Error |
Edit package by id
UPDATE package/
PUT /api/v1/auth/package/646cbc2988ac0f02e158909d
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACA1MjdhNmFjMjQzNTY0NWQxODJkYzEyMmU5MjJhMWMyM20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYA6v--SIgBYgABUYA.dBH3x-y32MN4nnT6hUquLIoc2sE8qGTjxucSIfvJ_2Q
origin: http://c1795b5f-138c-4bbe-ac6d-28aa37b348a2.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"name": "premium",
"limits": [
{
"value": -1,
"name": "query_string_support",
"label": "label"
},
{
"value": 20,
"name": "number_of_pages",
"label": "label"
},
{
"value": 1,
"name": "variation_per_page",
"label": "label"
},
{
"value": 10,
"name": "static_sections",
"label": "label"
},
{
"value": 5,
"name": "sections_total",
"label": "label"
},
{
"value": 7,
"name": "hosted_files",
"label": "label"
},
{
"value": 500000,
"name": "size_per_file",
"label": "label"
},
{
"value": 10,
"name": "api_limit_sec",
"label": "label"
},
{
"value": -1,
"name": "api_limit_hour",
"label": "label"
},
{
"value": 100,
"name": "api_limit_minute",
"label": "label"
},
{
"value": 500,
"name": "api_limit_day",
"label": "label"
},
{
"value": -1,
"name": "dynamic_section_types_support",
"label": "label"
},
{
"value": 2,
"name": "users",
"label": "label"
},
{
"value": 5,
"name": "domains",
"label": "label"
}
],
"label": "premium"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HIBItdrGo2zQMAA6xD
access-control-allow-origin: http://clientapp.com:3001
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "premium",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support"
},
{
"value": 20,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 7,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": -1,
"name": "api_limit_hour"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 5,
"name": "domains"
}
],
"label": "premium",
"id": "646cbc2988ac0f02e158909d"
}
Used to edit a package by its id.
Request
PUT api/v1/auth/package/:id
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
package_id | The package id in Sections | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Package Resource | Package |
400 | Error Resource | Error |
404 | Error Resource | Error |
Duplicate package by id
Duplicate package
POST /api/v1/auth/package/646cbc2e88ac0f02e1f58204/duplicate
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACBiODY5OTljZjA1N2E0ZmRkYWZjZTlmNmFjNjgzZDQxNG0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYA2BO_SIgBYgABUYA.R0naNlp7hDvkjlhVFmUHoC1hdkE_DTvKcuPTc5ToW1c
origin: http://6feccf12-23dc-499f-b57a-76b3567218d1.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"name": "package 2"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F2HIBbvJ7AMgKCYABLph
access-control-allow-origin: http://clientapp.com:3001
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "package 2",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support"
},
{
"value": 2,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 10,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": 100,
"name": "api_limit_hour"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 5,
"name": "domains"
}
],
"label": "Free",
"id": "646cbc2e88ac0f02e1f58205"
}
Used to duplicate a package by its id.
Request
GET api/v1/auth/package/:id/duplicate
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
name | Name of the package to be used when duplicating | body | string | true | Eweev Package #1 |
Responses
Status | Description | Schema |
---|---|---|
200 | Package Resource | Package |
400 | Error Resource | Error |
404 | Error Resource | Error |