The survey object
Attributes |
Id: int required, autogenerated, unique
The unique identifier for this survey |
Active: bool optional |
BusinessId: Id required |
DeliveryFrequency: Nexudus.Coworking.Core.Enums.eSurveyDeliveryFrequency optional |
DeliveryRate: int required |
Description: string required |
Name: string required |
NextDeliveryDate: DateTime required |
OnlyForContacts: bool optional |
OnlyForMembers: bool optional |
ScheduledJobId: string optional read-only |
UniqueId: Guid required, autogenerated, unique
The globally unique identifier for this survey |
SystemId: string optional api-only
User defined data about this survey. This property can only be seen and updated using the API. |
Json Structure Example
{
"Id": 1234567,
"Active": false,
"BusinessId": 12345678,
"DeliveryFrequency": 1,
"DeliveryRate": ,
"Description": "Abc123456",
"Name": "00001",
"NextDeliveryDate": 2020-01-01T21:03:54Z,
"OnlyForContacts": false,
"OnlyForMembers": false,
"ScheduledJobId": "ScheduledJobId",
"UniqueId": "42d908b6-a522-415f-aa48-ad253b14fd1a",
"SystemId": "{ metadata: { id: 887766, processed: true } }"
}
Find a Survey
This endpoint allows you to GET a list of surveys based on one or more filter querystring parameters.
GET https://spaces.nexudus.com/api/content/surveys?...
π Requires role "Survey-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 survey records based on their different properties. |
Id number
?Id=12345678 |
Survey_Active bool
?Survey_Active=... |
Survey_Business Business
?Survey_Business=... |
Survey_DeliveryFrequency Nexudus.Coworking.Core.Enums.eSurveyDeliveryFrequency
?Survey_DeliveryFrequency=... |
Survey_DeliveryRate int
?Survey_DeliveryRate=... |
Survey_Description string
?Survey_Description=... |
Survey_Name string
?Survey_Name=... |
Survey_NextDeliveryDate DateTime
?Survey_NextDeliveryDate=... |
Survey_OnlyForContacts bool
?Survey_OnlyForContacts=... |
Survey_OnlyForMembers bool
?Survey_OnlyForMembers=... |
Survey_ScheduledJobId string
?Survey_ScheduledJobId=... |
Survey_Tariffs List of Tariff
?Survey_Tariffs=... |
Range search querystring parameters
Lets you search survey records based on a range of date or numeric values. |
To_Survey_CreatedOn date
?To_Survey_CreatedOn=2010-01-01T20:32 |
From_Survey_CreatedOn date
?From_Survey_CreatedOn=2010-01-01T20:32 |
To_Survey_UpdatedOn date
?To_Survey_UpdatedOn=2010-01-01T20:32 |
From_Survey_UpdatedOn date
?From_Survey_UpdatedOn=2010-01-01T20:32 |
To_Survey_NextDeliveryDate date
?To_Survey_NextDeliveryDate=2010-01-01T20:32 |
From_Survey_NextDeliveryDate date
?From_Survey_NextDeliveryDate=2010-01-01T20:32 |
To_Survey_DeliveryRate number
?To_Survey_DeliveryRate=0 |
From_Survey_DeliveryRate number
?From_Survey_DeliveryRate=10 |
Example request
GET https://spaces.nexudus.com/api/content/surveys?Survey_Name=... Content-Type: application/json Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==
Example response
{
"Records": [{
"Id": 1234567,
"Business": ,
"Name": "00001",
"Description": "Abc123456",
"Active": false,
"NextDeliveryDate": 2020-01-01T21:03:54Z,
"DeliveryRate": ,
"DeliveryFrequency": 1,
"ScheduledJobId": "ScheduledJobId",
"OnlyForContacts": false,
"OnlyForMembers": false,
"CreatedOn": "2018-07-03T06:23:01Z",
"UpdatedOn": "2020-01-01T21:57:21Z",
"UpdatedBy": "System",
"UniqueId": "eb3df08d-4b7e-4d3f-89bb-ba1df49794a8",
"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 Surveys by IDs
Gets one or more survey records based on their Id.GET https://spaces.nexudus.com/api/content/surveys?Survey_Id=[:id1,:id2,...]
π Requires role "Survey-List"
Querystring parameters |
Survey_Id: array requried
?Survey_Id=[12345678,87654651] |
Example request
GET https://spaces.nexudus.com/api/content/surveys?Survey_Id=[1234567,9876541] Content-Type: application/json Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==
Example response
{
"Records": [{
"Id": 1234567,
"Business": ,
"Name": "00001",
"Description": "Abc123456",
"Active": false,
"NextDeliveryDate": 2020-01-01T21:03:54Z,
"DeliveryRate": ,
"DeliveryFrequency": 1,
"ScheduledJobId": "ScheduledJobId",
"OnlyForContacts": false,
"OnlyForMembers": false,
"CreatedOn": "2018-07-03T06:23:01Z",
"UpdatedOn": "2020-01-01T21:57:21Z",
"UpdatedBy": "System",
"UniqueId": "cad27a3e-b940-414d-9e33-9336bdb0e28e",
"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 Survey by Id
Gets one survey record by its Id.GET https://spaces.nexudus.com/api/content/surveys/:Id
π Requires role "Survey-Read"
URL parameters |
Id: number requried |
Example request
GET https://spaces.nexudus.com/api/content/surveys/1234567 Content-Type: application/json Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==
Example response
{
"Id": 1234567,
"Active": false,
"BusinessId": 12345678,
"DeliveryFrequency": 1,
"DeliveryRate": ,
"Description": "Abc123456",
"Name": "00001",
"NextDeliveryDate": 2020-01-01T21:03:54Z,
"OnlyForContacts": false,
"OnlyForMembers": false,
"ScheduledJobId": "ScheduledJobId",
"CreatedOn": "2018-07-03T06:23:01Z",
"UpdatedOn": "2020-01-01T21:57:21Z",
"UpdatedBy": "System",
"UniqueId": "3487fb8a-c615-4717-97d2-a602ca4b2bda",
"SystemId": "{ metadata: { id: 887766, processed: true } }"
}
Create new Survey
Creates a new survey.POST https://spaces.nexudus.com/api/content/surveys
π Requires role "Survey-Create"
Body parameters |
BusinessId: number required |
Name: string required |
Description: string required |
Active: bool optional |
NextDeliveryDate: DateTime required |
DeliveryRate: int required |
DeliveryFrequency: Nexudus.Coworking.Core.Enums.eSurveyDeliveryFrequency optional |
OnlyForContacts: bool optional |
OnlyForMembers: bool optional |
Example request
POST https://spaces.nexudus.com/api/content/surveys Content-Type: application/json Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==
{
"BusinessId": 12345678,
"Name": "00001",
"Description": "Abc123456",
"Active": false,
"NextDeliveryDate": 2020-01-01T21:03:54Z,
"DeliveryRate": ,
"DeliveryFrequency": 1, //(check Enumerated values section below)
"OnlyForContacts": false,
"OnlyForMembers": false,
"Tariffs": [12345678, 87654321],
}
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"
},
]
}
Update Survey
Updates an existing survey.PUT https://spaces.nexudus.com/api/content/surveys
PUT requests require ALL record properties to be submitted with every request. Any missing properties will be cleared or set to false.
π Requires role "Survey-Edit"
Body parameters |
Id: number required
The unique Id of the survey to update. |
BusinessId: number cleared if missing |
Name: string cleared if missing |
Description: string cleared if missing |
Active: bool cleared if missing |
NextDeliveryDate: DateTime cleared if missing |
DeliveryRate: int cleared if missing |
DeliveryFrequency: Nexudus.Coworking.Core.Enums.eSurveyDeliveryFrequency cleared if missing |
OnlyForContacts: bool cleared if missing |
OnlyForMembers: bool cleared if missing |
Example request
PUT https://spaces.nexudus.com/api/content/surveys Content-Type: application/json Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==
{
"Id": 12345678,
"BusinessId": 12345678,
"Name": "00001",
"Description": "Abc123456",
"Active": false,
"NextDeliveryDate": 2020-01-01T21:03:54Z,
"DeliveryRate": ,
"DeliveryFrequency": 1, //(check Enumerated values section below)
"OnlyForContacts": false,
"OnlyForMembers": false,
"Tariffs": [12345678, 87654321],
}
Example valid response
{
"Status": 200,
"WasSuccessful": true,
"Message": "Record 'Name of the record' has been succesfully updated.",
"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"
},
]
}
Delete Survey
Deletes an existing survey by its Id.DELETE https://spaces.nexudus.com/api/content/surveys/:Id
π Requires role "Survey-Delete"
URL parameters |
Id: number required
The unique Id of the survey to update. |
Example request
DELETE https://spaces.nexudus.com/api/content/surveys/12345678 Content-Type: application/json Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==
Example valid response
{
"Status": 200,
"WasSuccessful": true,
"Message": "The record was deleted successfully.",
"Value": null,
"OpenInDialog": false,
"RedirectURL": null,
"JavaScript": null,
"Errors": null
}
Commands
Commands allow to perform actions against one or more survey 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 survey records.GET https://spaces.nexudus.com/api/content/surveys/commands
Example request
GET https://spaces.nexudus.com/api/content/surveys/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 survey record IDs.POST https://spaces.nexudus.com/api/content/surveys/runacommandπ Requires role "Survey-Edit"
Example request
POST https://spaces.nexudus.com/api/content/surveys/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
}
Enumerated values
DeliveryFrequency
GET /api/utils/enums?name=eSurveyDeliveryFrequency
Comments
Please sign in to leave a comment.