CommunityThread API Resource


Base URL

https://spaces.nexudus.com/api/community/communitythreads

GET a list of CommunityThreads

Calling this API method requires your App to be assinged one of the following roles:

  • CommunityThread-List

GET https://spaces.nexudus.com/api/community/communitythreads
Request Url: community/communitythreads
Request Method: GET
Request Params: {}

Response Status Code: 200
Response Body:
{

    "Records": [{
        "BusinessId": 123456
        "CommunityGroupId": 123456
        "UserId": 123456
        "Subject": "00001"
        "Tags": "00001"
        "Private": false
        "LastMessageDate": null
        "UpdatedOn": "2010-09-16T03:05:32",
        "CreatedOn": "2010-08-31T13:45:29",
        "UniqueId": "a7399f21-8a5a-4837-a200-a44131ec50b3",
        "UpdatedBy": "user@example.com"
    }, {
        ...
    }, {
        ...
    }],
    "CurrentPageSize": 25,
    "CurrentPage": 1,
    "CurrentOrderField": "Id",
    "CurrentSortDirection": 1,
    "FirstItem": 1,
    "HasNextPage": true,
    "HasPreviousPage": false,
    "LastItem": 1,
    "PageNumber": 1,
    "PageSize": 25,
    "TotalItems": 45,
    "TotalPages": 2
}

Although the data structure returned by the request may contain several properties, only the ones outlined above will actually contain data. If you want the complete data structure for a communitythread use the GET method to retrieve a single record.

Use the parameters below to filter and search the list of results. You can pass any combinations of the parameters in the querystring of the request

GET https://spaces.nexudus.com/api/community/communitythreads?CommunityThread_Id=123456
GET https://spaces.nexudus.com/api/community/communitythreads?CommunityThread_Name=ABC12354
  • CommunityThread_Id

  • CommunityThread_Business

  • CommunityThread_CommunityGroup

  • CommunityThread_User

  • CommunityThread_Subject

  • CommunityThread_Message

  • CommunityThread_InstantDelivery

  • CommunityThread_Tags

  • CommunityThread_Private

  • CommunityThread_LastMessageDate

  • CommunityThread_Guests (returns a list)

You can also get a list of records based when they were created or updated. This is useful if you want to get a list of records created after or before a particuar id or point in time. The IDs are always unique and they always represent the order in which records are created. So a record with an Id of 10 will always be created before a record with an Id of 21.

If you use a date make sure is in the follwing format: yyyy-MM-ddTHH:mm:ssZ. For example: 2012-10-08T23:13:38Z

You use two special querystring parameters:

  • from_communitythread_id={id}: returns records with an Id greater (not equal) than {id}.

  • to_communitythread_id={id}: returns records with an Id smaller (not equal) than {id}.

GET https://spaces.nexudus.com/api/community/communitythreads?from_CommunityThread_Id=123456
GET https://spaces.nexudus.com/api/community/communitythreads?to_CommunityThread_id=123456
GET https://spaces.nexudus.com/api/community/communitythreads?from_CommunityThread_CreatedOn=2012-10-08T23:13:38Z
GET https://spaces.nexudus.com/api/community/communitythreads?to_CommunityThread_CreatedOn=2012-10-08T23:13:38Z
GET https://spaces.nexudus.com/api/community/communitythreads?from_CommunityThread_UpdatedOn=2012-10-08T23:13:38Z
GET https://spaces.nexudus.com/api/community/communitythreads?to_CommunityThread_UpdatedOn=2012-10-08T23:13:38Z

Additionally, as with all the listings, you can pass parameters to control sorting and page sizes

  • page (default: 1)

  • size (the size of each page. Default: 25, max: 1000)

  • orderby (the field used to order the results)

  • dir (default: Descending. options: Ascending or Descending)


Get single

Calling this API method requires your App to be assinged one of the following roles:

  • CommunityThread-Read

GET https://spaces.nexudus.com/api/community/communitythreads/{id}
Request Url: community/communitythreads
Request Method: GET
Request Params: {}
Response Status Code: 200
Response Body:
{
    "BusinessId": 123456
    "CommunityGroupId": 123456
    "UserId": 123456
    "Subject": "00001"
    "Message": "Message"
    "InstantDelivery": instant delivery
    "Tags": "00001"
    "Private": false
    "LastMessageDate": null
    "UpdatedOn": "2010-09-16T03:05:32",
    "CreatedOn": "2010-08-31T13:45:29",
    "UniqueId": "a7399f21-8a5a-4837-a200-a44131ec50b3",
    "UpdatedBy": "user@example.com"
}

Create

Invoking this method will create a communitythread record.

Calling this API method requires your App to be assinged one of the following roles:

  • CommunityThread-Create

POST https://spaces.nexudus.com/api/community/communitythreads
Request Url: community/communitythreads
Request Method: POST
Request Params: {}
Request Content-Type: application/json
Request Body:
{
    "BusinessId": 123456
    "UserId": 123456
    "Subject": "00001"
    "Message": "Message"
		
    //Add or remove guests
    "AddedGuests": [{12345, 56789}],
}
Response Status Code: 200
Response Body:
{
    "Status": 200,
    "WasSuccessful": true,
    "Message": "Record "Name of the record" has been succesfully created.",
    "Value": {
        "BusinessId": 123456
        "CommunityGroupId": 123456
        "UserId": 123456
        "Subject": "00001"
        "Message": "Message"
        "InstantDelivery": instant delivery
        "Tags": "00001"
        "Private": false
        "LastMessageDate": null
        "Id": 123456,
        "UpdatedOn": "2013-02-13T13:15:07.7527111Z",
        "CreatedOn": "2013-02-13T13:15:07.7527111Z",
        "UniqueId": "8a2648c6-f440-48f5-8601-ec96dee5f823",
        "UpdatedBy": "user@example.com",
    },
    "OpenInDialog": false,
    "RedirectURL": null,
    "JavaScript": null,
    "Errors": null
}

Please note that the data displayed in this request only includes those properties required to create a communitythread. You can also provide additional data when creating this record if you need to.


Delete

Invoking this method will delete a record based on its ID. The ID of the record is passed as part of the URL of the request.

Calling this API method requires your App to be assinged one of the following roles:

  • CommunityThread-Delete

DELETE https://spaces.nexudus.com/api/community/communitythreads/{id}
Request Url: community/communitythreads/123456
Request Method: DELETE
Response Status Code: 200
Response Body:

{
    "Status": 200,
    "WasSuccessful": true,
    "Message": "The record was deleted successfully.",
    "Value": null,
    "OpenInDialog": false,
    "RedirectURL": null,
    "JavaScript": null,
    "Errors": null
}

Update

Calling this API method requires your App to be assinged one of the following roles:

  • CommunityThread-Update

PUT https://spaces.nexudus.com/api/community/communitythreads
Request Url: community/communitythreads
Request Method: PUT
Request Content-Type: application/json
Params: {}

Request Body:
{
    "Id": 123456
    "BusinessId": 789456
    "UserId": 789456
    "Subject": "00001"
    "Message": "Message"
		
    //Add or remove guests
    "AddedGuests": [{12345, 56789}],
    "RemovedGuests": [{12345, 56789}],
}
Response Status Code: 200
Response Body:
{
    "Status": 200,
    "WasSuccessful": true,
    "Message": "The record "name of the record" was updated successfully,
    "Value": {
        "Id": 123456
    },
    "OpenInDialog": false,
    "RedirectURL": null,
    "JavaScript": null,
    "Errors": null
}

Complete Data Structure

Below is displayed the complete data structure for a communitythread. Not all the methods outlined in this page will populate data for all the properties in the structure. For example, the GET method to retrieve a list of communitythreads will only return a subset of this.

Response Status Code: 200
Response Body:
{

   "BusinessId": 123456
   "CommunityGroupId": 123456
   "UserId": 123456
   "Subject": "00001"
   "Message": "Message"
   "InstantDelivery": instant delivery
   "Tags": "00001"
   "Private": false
   "LastMessageDate": null
   "Id": 123456,
   "UpdatedOn": "2013-02-13T13:15:07.7527111Z",
   "CreatedOn": "2013-02-13T13:15:07.7527111Z",
   "UniqueId": "8a2648c6-f440-48f5-8601-ec96dee5f823",
   "UpdatedBy": "user@example.com"
}

Data Types

The list below provides the type for each of the fields avaialble for the communitythread entities.

"BusinessId": int
"CommunityGroupId": int
"UserId": int
"Subject": string
"Message": string
"InstantDelivery": bool
"Tags": string
"Private": bool
"LastMessageDate": DateTime?
"Id": int,
"UpdatedOn": DateTime,
"CreatedOn": DateTime,
"UniqueId": GUID,
"UpdatedBy": string
		

Related API Resources




Source: XML ! RSS