Register

Introduction

Through our REST API schools can update their Sematime accounts programmatically hence killing the need to update content manually. For example, a school can have their school management system update Sematime automatically whenever new exam results are entered.

Developers that wish to have their apps integrate with Sematime must first of all be registered with our developers program by visiting http://developers.sematime.com. Upon successful registration, you’ll be provided access to our developer portal that will help you manage your schools.

Base URL
All resources are referenced in the API have the following base: http://account.sematime.com/api/v1/

Authentication
We support token based authentication. Developers who wish to integrate their apps with Sematime must acquire an auth token from the school. During API access authorization, the school specifies the resources they wish to grant access to. The list of resources granted is called a ‘scope’. To get an auth token, send an integration request to the school from your developer portal. If access is granted, the auth token will be availed on your developer portal. The auth token must be included with every request as the ‘AuthToken’ header.

Resources
The API exposes the following resources:
a. /contacts
b. /sms
c. /chats
d. /exams
e. /fees
f. /events
g. /photos
h. /news

HTTP methods
We support POST, GET and PUT

Pagination
Some GET requests can generate responses that contain lots of records. For example, listing the contacts contained in a group. We provide the option of limiting response sizes through the use of two URL parameters:
a. rowCount – indicates the number of records you want to retrieve. Defaults to 20
b. lastOffset – indicates the index of the row where you would wish to start the retrieval. This value is always specified by the API server. Defaults to 0(zero)

See the table below for API response codes

Status Code Name Description
200 OK Description
400 Bad Request Improperly formatted request.
401 Unauthorized Request could not be authenticated due to incorrect login credentials or auth token.
403 Forbidden Request was accepted but could not be processed. For example, when a school’s subscrpription has expired
404 Not Found. Resource you are requesting could not be found.
500 Internal Server Error Server is unable to process your request possibly due to a problem on our side.

# All requests and responses are JSON formatted; with the exception of 
photos uploading. {"message":"We love JSON"} # Response formats # All responses received from the API are JSON formatted and will always
have the “statusCode” object whose value is a HTTP response code. e.g. 200,
404 etc. { "statusCode": 401, "description": "Permission denied - incorrect auth token" } # Status code 200 always denotes a successful request. Other response will
# always have an accompanying “description” object whose value is a
# message describing what you possibly did wrong.

Developer Key registration

You can register for a Sematime Developer Key using the below easy steps:

1. Go to http://developers.sematime.com and click on the Register buton on the top-right corner of the page:


2. Provide your details on the registration page and submit:


3. You will receive an email to with a confirmation link
4. Upon successful confirmation you will receive the following notifications containing your developer key:




5. Once your have received your developer key, submit this to the school you wish to integrate into Sematime and they can proceed to generate an AuthToken for you to access their Sematime data via API.

The following steps will be completed by the School.

6. Once logged in go into Settings:


7. On the Settings panel, select API Integrations:


8. Then Click on the +Add New Integration button.
9. You will be prompted to add the developer key from the previous section:

10. You will then be prompted to select which areas the school would like the developer to access:
11.Done! The developer can now access the School data via API.







/ CONTACTS

Sematime organizes contacts in groups.

NB: Group categories: students, teachers, non teaching staff or others. Category only required when adding to a new group

i. Adding contacts
POST /api/v1/contacts HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

Your POST request body should be a JSON string containing the following parameters:

studentNumber - Student's admission number.
name - Student's name.
primaryNumber - Parent's main contact number.
secondaryNumber - Optional alternative contact number

ii. Listing all contacts
Fetch a JSON Formatted list of all contacts in your address book. GET /api/v1/contacts HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

iii. Editing a contact
PUT /api/v1/contacts/1134370106937/edit HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

NB: JSON only contains the parameter to be edited e.g. to rename the above contact only provide {“name”:”Okewa Onami”}

iv. Deleting contact
POST /api/v1/contacts/1134370106937/delete HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

v. Listing all groups
GET /api/v1/contacts/groups HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

vi. Get group members
GET /api/v1/contacts/groups/442898218038915 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

vii. Renaming a group
PUT /api/v1/contacts/groups/442898218038915/rename HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

viii. Deleting a group
POST /api/v1/contacts/groups/442898218038915/rename HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)


# i.	Adding contacts

{
  "contacts": [
    {
      "studentNumber": "4497",
      "name": "Boniface Githinji",
      "primaryNumber": "0710628206",
      "secondaryNumber": "0764099306"
    },
    {
      "studentNumber": "4498",
      "name": "Oliver Ngumbo",
      "primaryNumber": "0706129100",
      "secondaryNumber": "0737189540"
    }
  ],
  "groupName": "Form 4 East",
  "category": "students"
}

# ii. Listing all contacts



# iii. Editing a contact

{
  "name": "Office Line",
  "primaryNumber": "0706129100",
  "secondaryNumber": "0764099306"
}

// Response will be a JSON Formatted status code e.g:

{"statusCode":200}

# iv. Deleting contact



# v. Listing all groups - sample JSON response

{
  "groups": [
    {
      "groupId": 442898218038915,
      "name": "2 West",
      "size": 36,
      "category": "students"
    },
    {
      "groupId": 442898203322284,
      "name": "3 East",
      "size": 3,
      "category": "students"
    }
  ],
  "rowCount": 20,
  "lastOffset": 20,
  "endOfData": false,
  "statusCode": 200
}

# vi.	Get group members

{
  "contacts": [
    {
      "contactId": 800390236362265,
      "name": "AMOS KINOTI",
      "primaryNumber": "0721984755",
      "secondaryNumber": "",
      "studentNumber": "8158"
    },
    {
      "contactId": 800390111014542,
      "name": "ANTONY MWENDA",
      "primaryNumber": "0710187694",
      "secondaryNumber": "",
      "studentNumber": "8167"
    }
  ],
  "rowCount": 20,
  "lastOffset": 20,
  "endOfData": false,
  "statusCode": 200
}

# vii. Renaming a group

{
  "name": "Mathematics Teachers"
}

# viii. Deleting a group




//i. Sample Java Code - Adding contacts

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"contacts\":[ {\"studentNumber\":\"4497\", \"name\":\"Boniface Githinji\",\"primaryNumber\":\"0710628206\",\"secondaryNumber\":\"0764099306\"}, {\"studentNumber\":\"4498\", \"name\":\"Oliver Ngumbo\",\"primaryNumber\":\"0706129100\",\"secondaryNumber\":\"0737189540\"} ], \"groupName\":\"Form 4 East\", \"category\":\"students\"}");
Request request = new Request.Builder()
  .url("http://account.sematime.com/api/v1/contacts/")
  .post(body)
  .addHeader("authtoken", "(Your AuthToken)")
  .addHeader("content-type", "application/json")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

//ii. Sample Java Code - Get contact List

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://account.sematime.com/api/v1/contacts/")
  .get()
  .addHeader("authtoken", "(Your AuthToken)")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

//iii. Sample Java Code - Edit a contact
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n  \"name\": \"Boniface Githinji\",\r\n  \"primaryNumber\": \"0706129100\",\r\n  \"secondaryNumber\": \"0764099306\"\r\n}");
Request request = new Request.Builder()
  .url("http://account.sematime.com/api/v1/contacts/1134370106937/edit")
  .put(body)
  .addHeader("authtoken", "(Your AuthToken)")
  .addHeader("content-type", "application/json")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

//v. Sample Java Code - List groups

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n  \"name\": \"Boniface Githinji\",\r\n  \"primaryNumber\": \"0706129100\",\r\n  \"secondaryNumber\": \"0764099306\"\r\n}");
Request request = new Request.Builder()
  .url("http://account.sematime.com/api/v1/contacts/groups")
  .get()
  .addHeader("authtoken", "1ad63cf06775416ba1bb413a516942e1")
  .addHeader("content-type", "application/json")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();






//i. Sample PHP Code - Add contacts

$request = new HttpRequest();
$request->setUrl('http://account.sematime.com/api/v1/contacts/');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json',
  'authtoken' => '(Your AuthToken)'
));

$request->setBody('{"contacts":[ {"studentNumber":"4497", "name":"Boniface Githinji","primaryNumber":"0710628206","secondaryNumber":"0764099306"}, {"studentNumber":"4498", "name":"Oliver Ngumbo","primaryNumber":"0706129100","secondaryNumber":"0737189540"} ], "groupName":"Form 4 East", "category":"students"}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}


//ii. Sample PHP Code - Getting contact list

$request = new HttpRequest();
$request->setUrl('http://account.sematime.com/api/v1/contacts/');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'authtoken' => '(Your AuthToken)'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

//iii. Sample PHP Code - Editing a contact
$request = new HttpRequest();
$request->setUrl('http://account.sematime.com/api/v1/contacts/1134370106937/edit');
$request->setMethod(HTTP_METH_PUT);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json',
  'authtoken' => '(Your AuthToken)'
));

$request->setBody('{
  "name": "Boniface Githinji",
  "primaryNumber": "0706XXXXXX",
  "secondaryNumber": "0764XXXXXX"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

//v. Sample PHP Code - List groups

$request = new HttpRequest();
$request->setUrl('http://account.sematime.com/api/v1/contacts/groups');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json',
  'authtoken' => '(Your AuthToken)'
));

$request->setBody('{
  "name": "Boniface Githinji",
  "primaryNumber": "0706129100",
  "secondaryNumber": "0764099306"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}


/ SMS

Send general SMS alerts.

i. Sending sms
POST /api/v1/sms HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
NB: signature and scheduledTime are optional. Recipients can be phone numbers or group names.

ii. Getting sent messages
GET /api/v1/sms HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

iii. Getting single sent message
GET /api/v1/sms/1466599080194 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

iv. Deleting a sent message
POST /api/v1/sms/1466599080194/delete HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

v. Getting scheduled messages
GET /api/v1/sms/scheduled HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

vi. Getting single scheduled message
GET /api/v1/sms/scheduled/1466599080194 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

vii. Edit scheduled message
PUT /api/v1/sms/scheduled/1466599080194/edit HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
NB: You do not have to provide all the parameters in your JSON only those that you plan to edit.

viii. Deleting a scheduled message
POST /api/v1/sms/scheduled/1466599080194/delete HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)


# i. Sending sms

{
  "message": "Hello world",
  "signature": "Sent by ABC School. Contacts - 0706129100",
  "recipients": "0710628206,GroupX",
  "scheduledTime": 1642139068265
}

# ii. Getting sent messages



# iii. Getting single sent message


# iv. Deleting a sent message


# v. Getting schedules messages


# vi. Getting single scheduled message


# vii. Edit scheduled message

{
  "message": "Hello world",
  "signature": "Sent by ABC School. Contacts - 0706129100",
  "recipients": "0710628206,GroupX",
  "scheduledTime": 1642139068265
}

# viii.	Deleting a scheduled message






/ CHATS

Real-time school chat.

i. Sending new chat

POST /api/v1/chats/1454829445634 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
NB: 1454829445634 – is the userId to chat with.

ii. Sending a new chat with attachment
POST /api/v1/chats/1454829445634/attachment HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

Content-Disposition: form-data; name="message"
Singer Akothee’s husband has bought her a brand new car just for being pregnant with her sixth child.

Content-Disposition: form-data; name="file"; filename="Paypal.png"
Content-Type: image/png

NB: This request must be accompanied with the Content-Type header having the value ‘form/multipart’. The ‘message’ part is optional.

iii. Listing all the chats logged in user has had

GET /api/v1/chats/ HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

iv. Listing all the chats logged in user had with a specific user
GET /api/v1/chats/1454829445634 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
NB: 1454829445634 - is the ID of the specific user

v. Getting online users/contacts in logged user’s roster(address book)
GET /api/v1/chats/online HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

vi. Getting logged in user’s chat credentials
GET /api/v1/chats/credentials HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)



# i. Sending new chat

{
  "message": "Hi, I just want to say thank you!"
}

# ii.	Sending a new chat with attachment



# iii. Listing all the chats logged in user has had



# iv.	Listing all the chats logged in user had with a specific user


 
# v. Getting online users/contacts in logged user’s roster(address book)



# vi.	Getting logged in user’s chat credentials








/ EXAMS

Send exam results or get detailed exam analysis, see graphs, compare past performances then download report cards.

i. Adding new exam results
POST /api/v1/exams HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

ii. Listing exams
GET /api/v1/exams?year=2015 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
To limit results done by a specific student just add the ‘studentNumber’ parameter in your request.

iii. Get student exam results
GET /api/v1/exams/1456903880932 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
The response will contain all the results per student but you can limit it by specifying the student number.

iv. Editing exam
You can edit an exam’s name, class size, best score, class average, term and year
PUT /api/v1/exams/1466691678403/edit HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
Your JSON only needs to have the object you wish to edit.

v. Editing student exam results
PUT /api/v1/exams/1466691678403/14080/edit HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

vi. Sending exam results via SMS

POST /api/v1/exams/1466691678403/smsalerts HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

The JSON array contains student numbers whose exam results you want to send


# i. Adding new exam results

{
  "examName": "Kisii County Mocks",
  "sendSmsAlerts": true,
  "columnMappings": {
    "Position": "RNK",
    "Admission Number": "ADM No.",
    "Name": "NAME",
    "Marks": "SCORE",
    "Grade": "MG",
    "Points": "SCORE"
  },
  "columnHeadings": [
    "ADM No.",
    "NAME",
    "ENG",
    "KISW",
    "MATH",
    "BIO",
    "PHY",
    "CHEM",
    "HIST",
    "GEO",
    "CRE",
    "AGRI",
    "D/D",
    "COMP",
    "FRN",
    "BST",
    "SCORE",
    "MG",
    "RNK",
    "",
    ""
  ],
  "results": [
    [
      "14036",
      "NJUE JACKSON MUGENBDI",
      "37",
      "56",
      "14",
      "31",
      "18",
      "43",
      "53",
      "65",
      "77",
      "35",
      "",
      "",
      "",
      "42",
      "471",
      "C-",
      "152",
      "",
      ""
    ],
    [
      "14080",
      "NGUGI COLLINS WAMBURU",
      "47",
      "62",
      "18",
      "35",
      "25",
      "21",
      "43",
      "66",
      "87",
      "37",
      "",
      "",
      "",
      "39",
      "480",
      "C-",
      "146",
      "",
      ""
    ]
  ]
}}

# ii.	Listing exams



# iii.	Get student exam results



# iv.	Editing exam

{
  "examName": "New Exam Name",
  "classSize": 210,
  "classAverage": "B+",
  "bestScore": "A-"
}

# Your JSON only needs to have the object you wish to edit. 

# v. Editing student exam results

[
  "14080",
  "Ngugi Collins M",
  "47",
  "62",
  "18",
  "35",
  "25",
  "21",
  "43",
  "66",
  "87",
  "37",
  "",
  "",
  "",
  "39",
  "480",
  "C",
  "146",
  "",
  ""
]

# vi.	Sending exam results via SMS

[
  "14080",
  "15091",
  "89010"
]

# The JSON array contains student numbers whose exam results you want to send

react.User.create(
  item="React Bootstrap Theme",
  price=1500,
  name="John McClane",
  email="john_mcclane@awesome.com",
  country="US",
  some_key="yey_JA390094AWPIWWN435",
  age=53
)
React_User::create(array(
  "item" => "React Bootstrap Theme",
  "price" => 1500,
  "name" => "John McClane",
  "email" => "john_mcclane@awesome.com",
  "country" => "US",
  "some_key" => "yey_JA390094AWPIWWN435",
  "age" => 53
));

/ FEES

See how much fee balance you owe the school, get fee structure breakdown and find ‘How to pay’ instructions.

i. Updating fee balances
POST /api/v1/fees HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
Only mandatory thing here is the balances JSON array, rest is optional.

ii. Listing fee balances
GET /api/v1/fees HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
To only show a specific student’s fee balance, just add the ‘studentNumber’ query parameter.

iii. Sending fee balances via SMS
POST /api/v1/fees/smsalerts HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
Only requirement here is the student numbers JSON array.

iv. Updating fee structure
POST /api/v1/fees/structure HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

v. Listing fee structure
GET /api/v1/fees/structure?classUnit=2 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
Remember to include the class unit e.g. 7 for std 7


# i. Updating fee balances

{
  "balances": [
    {
      "studentNumber": "14080",
      "amount": 4000
    },
    {
      "studentNumber": "15010",
      "amount": 46980
    }
  ],
  "sendSmsAlerts": true,
  "description": "Form 4 balance reminders",
  "extraMessage": "Pay via MPESA paybill 510800"
}

# Only mandatory thing here is the balances JSON array, rest is optional.

# ii. Listing fee balances



# iii. Sending fee balances via SMS

{
  "studentNumbers": [
    "14080",
    "15010"
  ],
  "extraMessage": "Pay via MPESA paybill 510800"
}

# iv. Updating fee structure

{
  "feeStructure": [
    {
      "votehead": "Boarding Fee",
      "termOneAmount": 5600,
      "termTwoAmount": 4900,
      "termThreeAmount": 3490,
      "classUnit": 3,
      "year": 2016
    }
  ]
}

# v. Listing fee structure



/ EVENTS

Access upcoming events and receive SMS reminders on the go.

i. Adding events
POST /api/v1/events HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

Name and startsOn are mandatory the rest are optional. The times are represented in milliseconds.

ii. Listing all events
GET /api/v1/events HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
Include ‘term’ as a query parameter to limit to just events from a given term.

iii. Getting a particular event’s details
GET /api/v1/events/1455542485494 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

iv. Editing an event
PUT /api/v1/events/1455542485494/edit HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
You need not provide all the JSON parameters only those that you wish to edit.

v. Deleting an event
POST /api/v1/events/1455542485494/delete HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)


# i. Adding events

{
  "name": "Visting Day",
  "description": "Come early as our chief guest, the Governor, will be leaving to attend another function",
  "guests": "0710628206,GroupX",
  "startsOn": 6180133074923,
  "endsOn": 10164282877612,
  "inviteOn": 6180133074923
}

# ii. Listing all events



# iii. Getting a particular event’s details



# iv.	Editing an event

{
  "name": "Visting Day",
  "description": "Come early as our chief guest, the Governor, will be leaving to attend another function",
  "guests": "0710628206,GroupX",
  "startsOn": 6180133074923,
  "endsOn": 10164282877612,
  "inviteOn": 6180133074923
}

# v. Deleting an event









/ PHOTOS

Photos are organized into albums. So before adding new photos we need to create a new album.

i. Creating a new album
POST /api/v1/photos/ HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

You will get the album Id in the location header or from the JSON response.

ii. Adding photos to an album
POST /api/v1/photos/1467195967261 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

Content-Disposition: form-data; name="file"; filename="logo.png"
Content-Type: image/png
We are basically uploading the photo so we need to specify the ‘Content-Type’ header with value ‘form/multipart’. We need to specify the album Id in URL

iii. Getting photos in album
GET /api/v1/photos/1465312691349 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

iv. Deleting an album
POST /api/v1/photos/1467195967261/delete HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

v. Editing an album
PUT /api/v1/photos/1467195967261/edit HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

You only need to specify the JSON object parameter you need to edit.

vi. Deleting a photo
POST /api/v1/photos/1465312691349/9925695338210/delete HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

Note the URL, /photos/{albumId}/{photoId}/delete


# i. Creating a new album

{
  "name": "Mt. Longonot Expedition",
  "description": "All the form 4 students hiked the mountain in preparation for their national exams starting next week"
}

# ii.	Adding photos to an album



# iii. Getting photos in album



# iv.	Deleting an album



# v.	Editing an album

{
  "name": "Mt. Longonot Expedition",
  "description": "All the form 4 students hiked the mountain in preparation for their national exams starting next week"
}

# vi. Deleting a photo







/ NEWS

Provide up-to the minute updates on all the important school news and announcements.

i. Post new article
POST /api/v1/news HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

We allow HTML content for the body. Both parameters are mandatory.

ii. Getting all news articles
GET /api/v1/news HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

iii. Getting the body/content of a particular news item
GET /api/v1/news/1452769148884 HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

iv. Editing an article
PUT /api/v1/news/1452769148884/edit HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)
Your JSON need not have both the title and body; include that which you wish to edit only.

v. Deleting an article
POST /api/v1/news/1452769148884/delete HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

vi. Adding comments to an article
POST /api/v1/news/1452769148884/comments HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

Comment is mandatory.

vii. Getting an article’s comments
GET /api/v1/news/1452769148884/comments HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

viii. Deleting a comment
POST /api/v1/news/1452769148884/comments/1452769243808/delete HTTP/1.1
Host: account.sematime.com
AuthToken: (Your AuthToken)

Note the URL - /news/{articleId}/comments/{commentId}/delete


# i. Post new article

{
  "title": "New School Bus",
  "body": "We are glad to let you know that we have a new school bus."
}

# ii.	Getting all news articles



# iii. Getting the body/content of a particular news item



# iv. Editing an article

{
  "title": "New School Bus",
  "body": "We are glad to let you know that we have a new school bus. "
}

# v. Deleting an article



# vi.	Adding comments to an article

{
  "comment": "The new bus looks so good",
  "ipAddress": "120.90.78.45",
  "userAgent": "Mozilla"
}

# vii. Getting an article’s comments



# viii. Deleting a comment