Szu API

The Szu API allow you to use our system programmatically. Currently we provide following functions.

Site functions:
 - Get sites list

Monitor functions:
- Check the sites / servers status.

Review functions:
- Get review sites list
- Get reviews list
   - We does not allow to reply via API, due to quality requirement.

Upcoming:
- Run auto test.
- Send review invitations

 

Generate API KEY

Before use the API, you must generate an API Key from:

Link : https://szu.be/szu/apiconfig

API Examples:

API URL :
https://szu.be/szu/api/{Method}/{Version}

Example : https://szu.be/szu/api/Test/v1?id=YOUR_API_ID&key=YOUR_API_KEY

Note : Each API call must contains  the id=YOUR_API_ID and key=YOUR_API_KEY.


API Methods

Test

Test the api access:

Mandatory Parameter
    action=test

URL Example : https://szu.be/szu/api/Test/v1?id=YOUR_API_ID&key=YOUR_API_KEY&action=test

Output:
{
  "method": "Test",
  "version": "v1",
  "time": 1498237107,
  "code": 200,
  "message": "Test method OK"
}


Site

Get sites list

Mandatory Parameter

    action=getSitesList

URL : https://szu.be/szu/api/Site/v1?id=YOUR_API_ID&key=YOUR_API_KEY&action=getSitesList


Output Example (Success)
{
  "method": "Site",
  "version": "v1",
  "time": 1498229211,
  "code": 200,
  "data": {
    "action": "getSitesList",
    "meta": {
      "count": 2
    },
    "data": [
      {
        "id": "1",
        "title": "my-domain-1"
      },
      {
        "id": "2",
        "title": "My domain 2"
      }
    ]
  }
}

Output Error 1 : Authentication failed
{
  "Error": "access denied",
  "code": 403
}

Check your api is enabled (https://szu.be/szu/apiconfig) and check YOUR_API_ID and  YOUR_API_KEY.


Output Error 1. (Action incorrect)
{
  "method": "Site",
  "version": "v1",
  "time": 1498229396,
  "code": 400,
  "exception": "The action getSitesLit is undefined"
}

Re check the action name (Here getSitesList not getSitesLit)

Output Error 2. (Action not set)
{
  "method": "Site",
  "version": "v1",
  "time": 1498229440,
  "code": 400,
  "exception": "You must specify the action (Ex : action=ACTION_NAME)"
}

Monitor


Mandatory Parameter

    action=getMonitorsList

URL : https://szu.be/szu/api/Monitor/v1?id=YOUR_API_ID&key=YOUR_API_KEY&action=getSitesList


Output (Success)
{
  "method": "Monitor",
  "version": "v1",
  "time": 1498230372,
  "code": 200,
  "data": {
    "action": "getMonitorsList",
    "meta": {
      "count": 1
    },
    "data": [
      {
        "id": "1597",
        "title": "drupal8.ovh - Header",
        "site": "3",
        "active": "1",
        "lastCheck": "1497625442",
        "lastOK": "1497625442",
        "lastError": "1497602763",
        "status": "1",
        "statusText": "OK"
      }
    ]
  }
}


Review

Get sites list

URL : https://szu.be/szu/api/Review/v1?id=YOUR_API_ID&key=YOUR_API_KEY&action=getSitesList

Mandatory parameters:
    action=getSitesList


Output Success:
{
  "method": "Review",
  "version": "v1",
  "time": 1498232934,
  "code": 200,
  "data": {
    "action": "getSitesList",
    "meta": {
      "count": 1
    },
    "data": [
      {
        "siteId": "1",
        "title": "Reviews of my-site.com"
      }
    ]
  }
}

Get Reviews list

URL https://szu.be/szu/api/Review/v1?id=YOUR_API_ID&key=YOUR_API_KEY&action=getReviewsList&siteId=1

Mandatory parameters:
    action=getReviewsList
    siteId
Optional parameters:
    from  : [0:n] , default : 0
    limit : [1:50], default : 10
    status : [NEW|REPLIED]

{
  "method": "Review",
  "version": "v1",
  "time": 1498234998,
  "code": 200,
  "data": {
    "action": "getReviewsList",
    "meta": {
      "count": 1
    },
    "data": [
      {
        "id": "1",
        "title": "Test",
        "status": "REPLIED",
        "created": "1496176140",
        "updated": "1498233550",
        "rate": "3",
        "recommend": "1",
        "name": "The name",
        "review": "Test review",
        "reply": "Test reply"
      }
    ]
  }
}