Overview
The Discussit developers API provides a standards based interface to the Discussit platform. We have made every effort to make the methods logical and easy to understand and have also endevoured to include full documentation, and examples where appropriate.
Authentication
All calls to the API must be digitally signed before any data can be returned. We use the OAuth protocol for authentifcation in our API implementation. This can be a little tricky to understand at first, so please read our authentication guide carefully.
Authentication Guide
When developers create an application for use with the Discussit API, our servers create a Consumer Key and a Consumer Secret. A digital signature is constructed by combining these two parameters with the OAuth Signature Method, Nonce, Timestamp, Token, and TokenSecret parameters.
You must create an application in the developer site to get your Consumer Key and Consumer Secret.
To reach a specific resource on the REST API, you must specify a RequestURL. The RequestURL is a concatenation of http://api.dis.cuss.it/main.svc/[Resource URL].
The OAuth protocol is used to validate the credentials of an application developer by means of the digital signature. If the external application signs the request, and our servers validate the digital signature, the developer is granted access to the requested resource.
This OAuth client test tool can be used as a starting point to familiarize yourself with the oAuth.
OAuth Authorisation Endpoints
http://api.dis.cuss.it/main.svc/getrequesttokenhttp://api.dis.cuss.it/main.svc/getaccesstoken
OAuth Parameters
The following are the OAuth parameters required for each REST request.
| Required | Name | Data Type | Description |
|---|---|---|---|
| yes | oauth_consumer_key | string | The consumer key associated with the calling application. |
| yes | oauth_signature_method | string | The signature method used to sign the request. |
| yes | oauth_signature | string | The oauth signature. |
| yes | oauth_token | string | The oauth token. |
| yes | oauth_timestamp | string | The oauth timestamp. |
| yes | oauth_nonce | string | The oauth none. |
| no | oauth_version | string | If present must by '1.0'. |
The REST API
The Dis.cuss.it API uses a REST-based interface. This means that our method calls are made over the internet by sending HTTP GET or POST requests to our REST server. Currently you can opt to have method results returned as either XML or JSON, depending on your preference.
Methods
Profiles.Get
Get a Profiles for Discussit.
Method Type
POST
Endpoint
http://api.dis.cuss.it/main.svc/profiles/get(.xml/.json)
Parameters
| Required | Name | Data Type | Description |
|---|---|---|---|
| yes | Identifier | string | The identifying url to the profile. |
Example Return XML
Example Return JSON
Messages.Thread.GetByID
Get a thread with its containing messages.
Method Type
POST
Endpoint
http://api.dis.cuss.it/main.svc/messages/thread/getbyid(.xml/.json)
Parameters
| Required | Name | Data Type | Description |
|---|---|---|---|
| Yes | Thread ID | GUID | The ID of the thread, obtained through using the Messages.Thread.Init method. |
Example Return XML
Example Return JSON
Messages.Thread.Init
Get surface data for a thread, including the ThreadID, needed for Messages.Thread.GetByID.
Method Type
POST
Endpoint
http://api.dis.cuss.it/main.svc/messages/thread/init(.xml/.json)
Parameters
| Required | Name | Data Type | Description |
|---|---|---|---|
| Yes | Url | String | The url where the widget resides. |
| Yes | Widget ID | GUID | The ID of the widget. |
Example Return XML
Example Return JSON
Messages.Message.Add
Add a message to a thread.
Method Type
POST
Endpoint
http://api.dis.cuss.it/main.svc/messages/message/add(.xml/.json)
Parameters
| Required | Name | Data Type | Description |
|---|---|---|---|
| Yes | Url | String | The url where the thread can be viewed. |
| Yes | Widget ID | GUID | The ID of the widget for the page where the message is being posted. |
| Dependant on widget | Identifier | String | The identifying url, e.g, openID, Facebook profile. |
| Yes | Nickname | String | The nickname of the poster. |
| No | String | An email for the poster. If not supplied the identifier will be used. | |
| No | Web Url | String | A web address for the poster. |
| Yes | Body | String | The message body. |
| No | Reply To ID | GUID | The ID of the message if replying to anything other than the root message. |
| Yes | Notify | Boolean | Poster to recive reply notices by email. |
Example Return XML
Example Return JSON
Messages.MessageStatus.Update
Update that status of a message, e.g. mark as withdrawn, aproved or spam.
Method Type
POST
Endpoint
http://api.dis.cuss.it/main.svc/messages/status/update(.xml/.json)
Parameters
| Required | Name | Data Type | Description |
|---|---|---|---|
| Yes | Message ID | GUID | The ID of the message to change status upon. |
| Yes | Status | Char | Set the status of a message (a, w or s - approved, withdraw or report spam). |
Example Return XML
Example Return JSON
Widgets.Get
Get all sites and contained widgets.
Method Type
POST
Endpoint
http://api.dis.cuss.it/main.svc/widgets/get(.xml/.json)
Parameters
No additional params are needed.
Example Return XML
Example Return JSON
Widgets.RecentMessages
Get a set of recent messages for specified a widget
Method Type
POST
Endpoint
http://api.dis.cuss.it/main.svc/widgets/recentmessages(.xml/.json)
Parameters
| Required | Name | Data Type | Description |
|---|---|---|---|
| Yes | Widget ID | GUID | The ID of the widget to get recent message for. |
| Yes | Date From | Date | The date you want to go back to when getting recent messages. (YYYY/MM/DD HH:MM:SS) |
Example Return XML
Example Return JSON
Example Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - It's likley that you missed one or more parameters. |
| 401 | Authentication failed - Check your oauth client is working correcly. |