Reference

Coworkermessage

The coworkermessage object

Attributes
Id: int required, autogenerated, unique
The unique identifier for this coworkermessage
Body: string optional
CoworkerId: Id required
EmailAccountId: Id optional
Incoming: bool optional read-only
IsNewMessage: bool optional read-only
Subject: string optional
UniqueId: Guid required, autogenerated, unique
The globally unique identifier for this coworkermessage
SystemId: string optional api-only
User defined data about this coworkermessage. This property can only be seen and updated using the API.

Json Structure Example


{
  "Id": 1234567,
  "Body": "Body",
  "CoworkerId": 12345678,
  "EmailAccountId": 12345678,
  "Incoming": false,
  "IsNewMessage": false,
  "Subject": "Subject",
  "UniqueId": "8322a69d-7d34-4d57-a176-df8dabd49069",
  "SystemId": "{ metadata: { id: 887766, processed: true } }"
}


Find a CoworkerMessage

This endpoint allows you to GET a list of coworkermessages based on one or more filter querystring parameters.

GET https://spaces.nexudus.com/api/spaces/coworkermessages?...

๐Ÿ”’ Requires role "CoworkerMessage-List"

Pagination querystring parameters
Lets control how many records to return at a time and their order.
page integer optional
?page=1
size integer optional default=25
Sets the maximum number of records to return each page of results.
?size=25
orderby string optional default=Id
Sets the property to use when ordering the results of the search.
?orderby=Id
dir 'ascending' or 'descending' optional default=SortDirection.Ascending
Sets the direction to use when ordering the records.
?sort=ascending

Search querystring parameters
Lets you search coworkermessage records based on their different properties.
Id number
?Id=12345678
CoworkerMessage_Body string
?CoworkerMessage_Body=...
CoworkerMessage_Coworker Coworker
?CoworkerMessage_Coworker=...
CoworkerMessage_EmailAccount EmailAccount
?CoworkerMessage_EmailAccount=...
CoworkerMessage_Incoming bool
?CoworkerMessage_Incoming=...
CoworkerMessage_IsNewMessage bool
?CoworkerMessage_IsNewMessage=...
CoworkerMessage_Subject string
?CoworkerMessage_Subject=...
CoworkerMessage_CoworkerFullName string
?CoworkerMessage_CoworkerFullName=...
CoworkerMessage_CoworkerEmail string
?CoworkerMessage_CoworkerEmail=...
CoworkerMessage_CoworkerBillingName string
?CoworkerMessage_CoworkerBillingName=...
CoworkerMessage_CoworkerCompanyName string
?CoworkerMessage_CoworkerCompanyName=...
CoworkerMessage_EmailAccountDisplayName string
?CoworkerMessage_EmailAccountDisplayName=...
CoworkerMessage_EmailAccountEmailAddress string
?CoworkerMessage_EmailAccountEmailAddress=...

Range search querystring parameters
Lets you search coworkermessage records based on a range of date or numeric values.
To_CoworkerMessage_CreatedOn date
?To_CoworkerMessage_CreatedOn=2010-01-01T20:32
From_CoworkerMessage_CreatedOn date
?From_CoworkerMessage_CreatedOn=2010-01-01T20:32
To_CoworkerMessage_UpdatedOn date
?To_CoworkerMessage_UpdatedOn=2010-01-01T20:32
From_CoworkerMessage_UpdatedOn date
?From_CoworkerMessage_UpdatedOn=2010-01-01T20:32

Example request

GET https://spaces.nexudus.com/api/spaces/coworkermessages?CoworkerMessage_Subject=...
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

Example response


{
    "Records": [{
        "Id": 1234567,
        "Coworker": ,
        "EmailAccount": ,
        "Subject": "Subject",
        "Body": "Body",
        "IsNewMessage": false,
        "Incoming": false,
        "CoworkerMessageCoworkerFullName": "...",
        "CoworkerMessageCoworkerEmail": "...",
        "CoworkerMessageCoworkerBillingName": "...",
        "CoworkerMessageCoworkerCompanyName": "...",
        "CoworkerMessageEmailAccountDisplayName": "...",
        "CoworkerMessageEmailAccountEmailAddress": "...",
        "CreatedOn": "2018-07-03T06:23:01Z",
        "UpdatedOn": "2020-01-01T21:57:21Z",
        "UpdatedBy": "System",
        "UniqueId": "e64a2869-b9af-40bf-8771-a7aeea526390",
        "SystemId": "{ metadata: { id: 887766, processed: true } }"
    }],
    "CurrentPageSize": 25,
    "CurrentPage": 1,
    "CurrentOrderField": "Id",
    "CurrentSortDirection": 1,
    "FirstItem": 1,
    "HasNextPage": true,
    "HasPreviousPage": false,
    "LastItem": 25,
    "PageNumber": 1,
    "PageSize": 25,
    "TotalItems": 60,
    "TotalPages": 3
}


Find CoworkerMessages by IDs

Gets one or more coworkermessage records based on their Id.
GET https://spaces.nexudus.com/api/spaces/coworkermessages?CoworkerMessage_Id=[:id1,:id2,...]

๐Ÿ”’ Requires role "CoworkerMessage-List"

Querystring parameters
CoworkerMessage_Id: array requried
?CoworkerMessage_Id=[12345678,87654651]

Example request

GET https://spaces.nexudus.com/api/spaces/coworkermessages?CoworkerMessage_Id=[1234567,9876541]
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

Example response


{
    "Records": [{
        "Id": 1234567,
        "Coworker": ,
        "EmailAccount": ,
        "Subject": "Subject",
        "Body": "Body",
        "IsNewMessage": false,
        "Incoming": false,
        "CoworkerMessageCoworkerFullName": "...",
        "CoworkerMessageCoworkerEmail": "...",
        "CoworkerMessageCoworkerBillingName": "...",
        "CoworkerMessageCoworkerCompanyName": "...",
        "CoworkerMessageEmailAccountDisplayName": "...",
        "CoworkerMessageEmailAccountEmailAddress": "...",
        "CreatedOn": "2018-07-03T06:23:01Z",
        "UpdatedOn": "2020-01-01T21:57:21Z",
        "UpdatedBy": "System",
        "UniqueId": "afc560ca-5d5d-497d-98a3-0ba59faeed4e",
        "SystemId": "{ metadata: { id: 887766, processed: true } }"
    }],
    "CurrentPageSize": 25,
    "CurrentPage": 1,
    "CurrentOrderField": "Id",
    "CurrentSortDirection": 1,
    "FirstItem": 1,
    "HasNextPage": true,
    "HasPreviousPage": false,
    "LastItem": 1,
    "PageNumber": 1,
    "PageSize": 25,
    "TotalItems": 1,
    "TotalPages": 1
}


Get single CoworkerMessage by Id

Gets one coworkermessage record by its Id.
GET https://spaces.nexudus.com/api/spaces/coworkermessages/:Id

๐Ÿ”’ Requires role "CoworkerMessage-Read"

URL parameters
Id: number requried

Example request

GET https://spaces.nexudus.com/api/spaces/coworkermessages/1234567
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

Example response


{
  "Id": 1234567,
  "Body": "Body",
  "CoworkerId": 12345678,
  "EmailAccountId": 12345678,
  "Incoming": false,
  "IsNewMessage": false,
  "Subject": "Subject",
  "CreatedOn": "2018-07-03T06:23:01Z",
  "UpdatedOn": "2020-01-01T21:57:21Z",
  "UpdatedBy": "System",
  "UniqueId": "0b50fc78-e07d-49c6-8846-b25cd0a5f635",
  "SystemId": "{ metadata: { id: 887766, processed: true } }"
}


Create new CoworkerMessage

Creates a new coworkermessage.
POST https://spaces.nexudus.com/api/spaces/coworkermessages

๐Ÿ”’ Requires role "CoworkerMessage-Create"

Body parameters
CoworkerId: number required
EmailAccountId: number optional
Subject: string optional
Body: string optional

Example request

POST https://spaces.nexudus.com/api/spaces/coworkermessages
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

{
    "CoworkerId": 12345678,
    "EmailAccountId": 12345678,
    "Subject": "Subject",
    "Body": "Body",
}


Example valid response


{
    "Status": 200,
    "WasSuccessful": true,
    "Message": "Record 'Name of the record' has been succesfully created.",
    "Value": {
        "Id": 12354678
    }
}


Example invalid response


{
    "Status": 500,
    "Message": "Name: may not be null or empty",
    "Value": null,
    "WasSuccessful": false,
    "Errors": [
        {
            "AttemptedValue": null,
            "Message": "may not be null or empty",
            "PropertyName": "Name"
        },
    ]
}


Commands

Commands allow to perform actions against one or more coworkermessage records. Some commands accept only one record while others can run an action for a number of records at the same time. Each command has metadata with information about how it can be used and the amount of records, if any, it needs to run.

Get Commands

Get all commands available to run for coworkermessage records.
GET https://spaces.nexudus.com/api/spaces/coworkermessages/commands

Example request

GET https://spaces.nexudus.com/api/spaces/coworkermessages/commands
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

Example valid response


[
	{
		"Key": "COMMAND_KEY_1",
		"Name": "Command 1 english description",
		"AppliesOnlyToMultipleEntities": false,
		"DisplayInDropdown": true,
		"DisplayInDropdownV2": true,
		"AppliesOnlyToOneEntity": false,
		"AppliesOnlyToTwoEntities": false,
		"DisplayInGrid": false,
		"NeedsEntitiesToRun": true,
		"Order": 2,
		"RequiresParameters": []
	},
	{
		"Key": "COMMAND_KEY_2",
		"Name": "Command 2 english description",
		"AppliesOnlyToMultipleEntities": false,
		"DisplayInDropdown": true,
		"DisplayInDropdownV2": true,
		"AppliesOnlyToOneEntity": true,
		"AppliesOnlyToTwoEntities": false,
		"DisplayInGrid": true,
		"NeedsEntitiesToRun": true,
		"Order": 10,
		"RequiresParameters": 
		[
			{
				"Name": "Parameter 1 description",
				"Type": "string",
			},
			{
				"Name": "Parameter 2 description",
				"Type": "Boolean",
			}
		]
	},
	...
]


Run Command

Runs a command based on its Key and one or more coworkermessage record IDs.
POST https://spaces.nexudus.com/api/spaces/coworkermessages/runacommand
๐Ÿ”’ Requires role "CoworkerMessage-Edit"

Example request

POST https://spaces.nexudus.com/api/spaces/coworkermessages/runcommand
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

{
	"Ids":[1329961649],
	"Parameters": 
	[
		{ 
			"Type": "string"
			"Value":987654321
		},
		{
			"Type": "Boolean",
			"Value":true
		},
		...
	],
	"Key":"COMMAND_KEY_2"
}


Example valid response


{
	"Errors": null
	"JavaScript": null
	"Message": "Result description"
	"OpenInDialog": false
	"OpenInWindow": false
	"RedirectURL": null
	"Status": 200
	"UpdatedBy": "email@example.net"
	"UpdatedOn: "2020-06-04T11:40:20Z"
	"Value: {Id: 12345678}
	"WasSuccessful: true
}


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Please sign in to leave a comment.