Calendar

In this Article:

  1. GET /apiv2/calendar/
  2. GET /apiv2/calendar/{id}
  3. GET /apiv2/calendar/{reference}
  4. POST /apiv2/calendar/
  5. PUT /apiv2/calendar/{id}
  6. DELETE /apiv2/calendar/{id}

GET /apiv2/calendar/

Get a list of calendars.

Parameter Required Description
apiKey YES The apiKey provided by ECAL and is found in Publisher Admin Portal
apiSign YES MD5 string of all parameters signed by the SECRET
showDraft NO Set this parameter to show draft calendars

GET /apiv2/calendar/{id}

Get a single calendar and its full details. If id is not set, the request will be recognized as GET /api/calendar/

Parameter Required Description
apiKey YES The apiKey provided by ECAL and is found in Publisher Admin Portal
apiSign YES MD5 string of all parameters signed by the SECRET

GET /apiv2/calendar/{reference}

Get a single calendar and its full details by reference

Parameter Required Description
apiKey YES The apiKey provided by ECAL and is found in Publisher Admin Portal
apiSign YES MD5 string of all parameters signed by the SECRET

POST /apiv2/calendar/

Creates a new calendar

Parameter Required Description
apiKey YES The apiKey provided by ECAL and is found in Publisher Admin Portal
apiSign YES MD5 string of all parameters signed by the SECRET

Parameters

The calendar data must be posted as a RAW JSON string.

The list below shows the fields available:

Field Type Required Description
name string YES The name of the calendar. Must be between 2 and 250 characters
type string/enum YES The type of calendar. The available types is fixture
categories string YES The categories to which this calendar belongs.

Each of the specified categories can represent a path of nested categories. For e.g. a Calendar can belong to a category called Basketball, where that category itself belongs to a parent category called Sports. Category paths are separated with a forward slash. E.g. Sports/Basketball

Multiple categories can be specified, separated with a comma, or a comma with a leading space. E.g. Sports/Basketball,Country/Australia or Sports/Basketball, Country/Australia.

Any categories that don’t already exist in the system, will automatically be created. Existing categories will automatically be reused. This applies to nested categories, where one or more categories at different levels of the nesting are either present or missing, they get reused or created on-the-fly.
reference string YES Unique id provided by the developer as a reference to the corresponding record in your system
note string/enum NO Internal Note/Description for the calendar
logo string NO The Logo Image of the calendar. The value must contain a full URL to the image
draftCalendar bit NO Values set must be either 0 or 1 (default). If set to 1 the calendar is hidden from public consumption and will not show up in widget

Example POST Data

The calendar data must be posted as a RAW JSON string. The list below shows the fields available:

Request
{
     "name": "Test Calendar",
     "type": "fixture",
     "categories": "sports/basketball,country/australia",
     "note": "This is a test calendar",
     "reference" : "CAL12",
     "draftCalendar" : 0,
     "logo" : "http://ecal.com/ecal_logo_150.png"
  }
Response
{   
    "status":"200",
    "statusLong":"OK",
    "calendarId":"5215bef8b499921657000000"
}

PUT /apiv2/calendar/{id}

Update calendar based on id

Parameter Required Description
apiKey YES The apiKey provided by ECAL and is found in Publisher Admin Portal
apiSign YES MD5 string of all parameters signed by the SECRET

Parameters

The calendar data must be posted as a RAW JSON string.

The list below shows the fields available:

Field Type Required Description
name string NO The name of the calendar. Must be between 2 and 250 characters
categories string NO The categories to which this calendar belongs.
Each of the specified categories can represent a path of nested categories. For e.g. a Calendar can belong to a category called ‘Basketball’, where that category itself belongs to a parent category called ‘Sports’. Category paths are separated with a forward slash. E.g. Sports/Basketball
Multiple categories can be specified, separated with a comma, or a comma with a leading space. E.g. “Sports/Basketball,Country/Australia” or “Sports/Basketball, Country/Australia”.
Any categories that don’t already exist in the system, will automatically be created. Existing categories will automatically be reused. This applies to nested categories, where one or more categories at different levels of the nesting are either present or missing, they get reused or created on-the-fly.
reference string NO Unique id provided by you as a reference to the corresponding record in your system
note string/enum NO Internal Note/Description for the calendar
logo string NO The Logo Image of the calendar. The value must contain a full URL to the image
draftCalendar bit NO Values set must be either 0 or 1 (default). If set to 1 the calendar is hidden from public consumption and will not show up in widget

Sample PUT Calendar Data

Request
{
    "name": "Test Calendar Updated",
    "note": "This is a test calendar updated",
    "draftCalendar" : 1,
    "logo" : "http://ecal.com/ecal_logo_150.png"
}
Response
{   
    "status":"200",
    "statusLong":"OK",
    "calendarId":"5215bef8b499921657000000"
}

DELETE /apiv2/calendar/{id}

Delete a single calendar and its event and event_history details. If id is not set it will return 400 No Data Provided

Parameter Required Description
apiKey YES The apiKey provided by ECAL and is found in Publisher Admin Portal
apiSign YES MD5 string of all parameters signed by the SECRET
Response
{
  "status": 200,
  "statusLong": "OK"
}