Easy Blog Networks API Introduction

Conventions

  1. The API is based on Representational State Transfer (REST) software architecture concept and as such makes heavy use of HTTP methods.
  2. The API always returns results in the JSON format. All POST, PUT and PATCH requests should send their payloads in JSON as well.
  3. All API paths end with a trailing slash.
  4. Authentication is required for all API services, except for the ping service. To authenticate, provide your email and your API Key as HTTP Basic Auth headers. Examples for each service are provided below. You can get your API Key on the Account Settings page.

The Ping service

Before your start connection to other EBN API services, it is helpful to test your connection against our ping service. First do a GET request to test you can reach our API, then do a POST request with your API credentials included to test that you can successfully authenticate to the EBN API.

Ping service at /api/v1/ping/

GET

A service for testing connection to the Easy Blog Networks API.

Usage example:

$ curl https://app.easyblognetworks.com/api/v1/ping/
{"ping": "pong"}

Response: json

POST

Accepted content types:
  • application/json

A service for testing authentication with the Easy Blog Networks API.

Usage example:

$ curl --user EMAIL:API_KEY --data ""
    https://app.easyblognetworks.com/api/v1/ping/
{"authenticated_user": "EMAIL", "ping": "pong"}

Response: json


Services

See also:

Blog service at /api/v1/blogs/{blog_id}/

GET

values in the body
  • fields (String) - (optional) Only requested fields will be returned

A service for getting a single Blog.

WordPress auto-login url:

The “wp_auto_login” property can be used to login user as admin user to the blog. Validity of this value is short, so it must not be cached.

Usage example:

$ curl --user EMAIL:API_KEY
    https://app.easyblognetworks.com/api/v1/blogs/1/
{
    "id": 1,
    "created": "2015-07-08",
    "domain": "blog1.com",
    "network": "Default network",
    "wp_auto_login": "http://blog1.com/?auth=secret",
    "wp_admin_username": "admin",
    "wp_admin_password": "secret",
    "dns_configured": true,
    "nameservers": [
        "ns1.provider.com",
        "ns2.provider.com"
    ],
    "backup_list": [
        {
            "date": "2014-12-15T06:54:52.000Z",
            "id": 1,
            "size": 1
        },
        {
            "date": "2015-12-15T06:54:52.000Z",
            "id": 3,
            "size": 2
        },
        {
            "date": "2012-12-15T06:54:52.000Z",
            "id": 2,
            "size": 3
        }
    ],
    "last_backup": "2015-12-15T06:54:52Z",
    "backup_status": true,
    "backup_used_bytes": 6,
    "indexation": "indexed",
    "indexation_checked": "2015-07-08T18:34:06Z",
    "domain_authority": 25,
    "last_domain_authority": "2015-07-08T18:34:06Z",
    "status": "up",
    "majestic_metrics": null,
    "last_majestic_metrics": null,
    "pages": 14,
    "posts": 5,
    "last_post": "1 year, 1 month ago",
    "comments": 13,
    "users": 7,
    "plugins": 5,
    "traffic_bytes": 62295184,
    "redirects": ["/a", "/b"],
    "not_found_pages": ["/not_found", "/also_not_found"],
    "health_score": 87,
    "server": {
        "ip": "1.2.3.4",
        "provider": {
            "title": "Big Provider"
        }
    },
    "health_score_color": warning,
    "delete_after": None
}

Validate the location against the schema defined on the service.

The content of the location is deserialized, validated and stored in the request.validated attribute.

Note

If no schema is defined, this validator does nothing.

Param request:Current request
Type request:Request
Param schema:The Colander schema
Param deserializer:
 Optional deserializer, defaults to cornice.validators.extract_cstruct()

Response: json

DELETE

A service for scheduling a deletion of a blog.

Usage example:

$ curl --user EMAIL:API_KEY -X DELETE
    https://app.easyblognetworks.com/api/v1/blogs/1/
HTTP/1.1 202 Accepted

Response: json

Blog service at /api/v1/blogs/

GET

values in the body
  • fields (String) - (optional) Only requested fields will be returned
  • page (Integer) - (default: 1)
  • page_size (Integer) - (default: 10)

A service for listing all user’s Blogs.

Usage example:

$ curl --user EMAIL:API_KEY
    https://app.easyblognetworks.com/api/v1/blogs/?page=1&page_size=10
{
    "page": 1,
    "pages_count": 1,
    "blogs": [
                {
                    "id": 2,
                    "domain": "blog2.com",
                    "network": "Default Network",
                    "status": "up",
                },
                {
                    "id": 3,
                    "domain": "blog3.com",
                    "network": "Default Network",
                    "status": "deploying",
                }
            ]
}

Validate the location against the schema defined on the service.

The content of the location is deserialized, validated and stored in the request.validated attribute.

Note

If no schema is defined, this validator does nothing.

Param request:Current request
Type request:Request
Param schema:The Colander schema
Param deserializer:
 Optional deserializer, defaults to cornice.validators.extract_cstruct()

Response: json

POST

Accepted content types:
  • application/json

A service for creating a new Blog.

This service will also schedule an immediate deployment of the newly created Blog.

Usage example:

$ curl --user EMAIL:API_KEY --data '{"blog":{
    "domain":"myblog.com","title":"My Blog","network":"1"},
     "wp": {"tagline", "My blog", "plugins": ["akismet"],
     "theme":"editor"}}' -H "Content-Type: application/json"
    https://app.easyblognetworks.com/api/v1/blogs/
{
    "id": 1,
    "domain": "myblog.com",
    "network": "Default network",
    "status": "deploying",
    "server": {
        "ip": "1.2.3.4",
        "provider": {
            "title": "Big Provider"
        }
    }
}

Blog API validator.

Args:
request (pyramid.request): Pyramid request.
Returns:
cornice.validators.colander_body_validator: Colander validator.

Response: json

Blognetwork service at /api/v1/networks/{network_id}/

GET

A service for getting a single Blog Network.

Usage example:

$ curl --user EMAIL:API_KEY
    https://app.easyblognetworks.com/api/v1/networks/1/
{
    "id": 1,
    "title": "Default network",
    "blogs_count": 2,
    "blogs_limit": 10
}

Response: json

DELETE

A service for deleting a Blog Network.

Usage example:

$ curl --user EMAIL:API_KEY -X DELETE -i
    https://app.easyblognetworks.com/api/v1/networks/1/
HTTP/1.1 204 No Content

Response: json

Blognetwork service at /api/v1/networks/

GET

A service for listing all user’s Blog Networks.

Usage example:

$ curl --user EMAIL:API_KEY
    https://app.easyblognetworks.com/api/v1/networks/
[
    {
        "id": 1,
        "title": "Default Network",
        "blogs_count": 2,
        "blogs_limit": 10,
    },
    {
        "id": 2,
        "title": "Second Network",
        "blogs_count": 3,
        "blogs_limit": 10,
    }
]

Response: json

POST

Accepted content types:
  • application/json

A service for creating a new Blog Network.

Usage example:

$ curl --user EMAIL:API_KEY --data '{"title":"My Network"}'
    -H "Content-Type: application/json"
    https://app.easyblognetworks.com/api/v1/networks/
{
    "id": 1,
    "title": "My Network",
    "blogs_count": 0,
    "blogs_limit": 10
}

Blog network API validator.

Args:
request (pyramid.request): Pyramid request.
Returns:
cornice.validators.colander_body_validator: Colander validator.

Response: json