Campaign
Method: get
Authorization is required. Email campaign is a way to send mess emails to members of your group or external emails. They can be manually send or automatically triggered.
Request
HTTP request
GET https://<YOUR_DOMAIN>/api/v1/en_US/campaign/{campaignId}
Parameters
property | value | description |
---|---|---|
campaignId | integer | The campaign's ID |
Request body
Do not supply a request body with this method.
Response
If successful, this method returns a response JSON with the following structure:
{ "success": true, "message": "Nisi proident tempor cillum sint duis eu elit dolor Lorem amet qui officia occaecat.", "timestamp": "2014-03-03T23:20:23Z", "errors": {}, "object": { "id": 2, "type": "campaign", "subject": "Campaign #2 subject", "content": "Campaign #2 content", "sendOn": "2014-03-03T23:20:23Z", "statusId": 1, "statusName": "pending", "group": { "id": "83acbf0f-b920-4ecb-a61e-e85bbfaaa52f", "name": "ea", "slug": "Home", "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png", "url": "http://demo.hivesocialnow.com/Home/" }, "campaignGroup": { "id": 1, "name": "Some campaign group", "description": "Description for some campaign group" }, "userRole": null, "trigger": null, "accessWarnings": [] } }
The general response properties are described on the Response format page. Here are the list of the specific properties for this method.
property | value | description |
---|---|---|
id | integer | the id of the record |
subject | string | the subject of the emails generated by the campaign |
content | string | the content of the emails generated by the campaign |
statusId | integer | the id of the current campaign status as follows:
|
statusName | string | human readable description of the campaign state |
group | object | some common properties of the group in which the record was created: id, name, slug, thumbUrl, url (of the group home page) |
campaignGroup | object | The selected recipients group by the campaign described by its id, name and description. Alternative to the "userRole" selection. Could be "null" if the user role option is selected for this campaign |
userRole | string | Instead of using a pre-filled campaign group of recipients, send the emails to all members with the selected user role. The object is defined with the role Id and name. Could be "null" if the campaign group option is selected for this campaign. |
trigger | object | The selected automatic trigger of the campaign. It is null if no trigger is selected and the campaign could be triggered only manually. This is the property that separates the Manually sent campaign from the Auto triggered campaigns. |
Method: Manually started list
Authorization is required. List of campaigns that are manually started by the groups' administrators.
Request
HTTP request
GET https://<YOUR_DOMAIN>/api/v1/en_US/campaign/manually-sent/list/{groupId}?offset={offset}&pageSize={pageSize}&recipients={recipients}&stateId={stateId}
Parameters
property | value | description |
---|---|---|
groupId | guid | The campaign's group ID |
offset | integer | Needed for the infinite scroll functionality. It is the ID of the last presented item to the user. After the request list is generated the system will skip all records from the beginning up to the record with the provided ID (including it). The next batch of records will be returned in the response. |
pageSize | integer | How many records to be returned by the system. Usually 15 |
recipients | string | Id of the recipient group, as follows:
|
stateId | integer | the id of the current campaign status as follows:
|
Request body
Do not supply a request body with this method.
Response
If successful, this method returns a response JSON with the following structure:
{ "success": true, "message": "Esse anim incididunt duis nostrud veniam nisi ut non in duis dolor cupidatat enim.", "timestamp": "2014-03-03T23:20:23Z", "errors": {}, "object": { "offset": 11, "campaigns": [ { "id": 1, "type": "campaign", "subject": "Campaign #1 subject", "content": "Campaign #1 content", "sendOn": "2014-03-03T23:20:23Z", "statusId": 1, "statusName": "pending", "group": { "id": "83acbf0f-b920-4ecb-a61e-e85bbfaaa52f", "name": "ea", "slug": "Home", "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png", "url": "http://demo.hivesocialnow.com/Home/" }, "campaignGroup": null, "userRole": { "id": 2, "name": "regular" }, "trigger": null, "accessWarnings": [] } ] } }
The general response properties are described on the Response format page. Here are the list of the specific properties for this method.
property | value | description |
---|---|---|
id | integer | the id of the record |
subject | string | the subject of the emails generated by the campaign |
content | string | the content of the emails generated by the campaign |
statusId | integer | the id of the current campaign status as follows:
|
statusName | string | human readable description of the campaign state |
group | object | some common properties of the group in which the record was created: id, name, slug, thumbUrl, url (of the group home page) |
campaignGroup | object | The selected recipients group by the campaign described by its id, name and description. Alternative to the "userRole" selection. Could be "null" if the user role option is selected for this campaign |
userRole | string | Instead of using a pre-filled campaign group of recipients, send the emails to all members with the selected user role. The object is defined with the role Id and name. Could be "null" if the campaign group option is selected for this campaign. |
trigger | object | The selected automatic trigger of the campaign. It is null if no trigger is selected and the campaign could be triggered only manually. This is the property that separates the Manually sent campaign from the Auto triggered campaigns. |
Method: Automatically Triggered list
Authorization is required. List of campaigns that are manually started by the groups' administrators.
Request
HTTP request
GET https://<YOUR_DOMAIN>/api/v1/en_US/campaign/auto-triggered/list/{groupId}?offset={offset}&pageSize={pageSize}
Parameters
property | value | description |
---|---|---|
groupId | guid | The campaign's group ID |
offset | integer | Needed for the infinite scroll functionality. It is the ID of the last presented item to the user. After the request list is generated the system will skip all records from the beginning up to the record with the provided ID (including it). The next batch of records will be returned in the response. |
pageSize | integer | How many records to be returned by the system. Usually 15 |
Request body
Do not supply a request body with this method.
Response
If successful, this method returns a response JSON with the following structure:
{ "success": true, "message": "Esse anim incididunt duis nostrud veniam nisi ut non in duis dolor cupidatat enim.", "timestamp": "2014-03-03T23:20:23Z", "errors": {}, "object": { "offset": 11, "campaigns": [ { "id": 4, "type": "campaign", "subject": "Campaign #4 subject", "content": "Campaign #4 content", "sendOn": "2014-03-03T23:20:23Z", "statusId": 1, "statusName": "pending", "group": { "id": "83acbf0f-b920-4ecb-a61e-e85bbfaaa52f", "name": "ea", "slug": "Home", "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png", "url": "http://demo.hivesocialnow.com/Home/" }, "campaignGroup": null, "userRole": null, "trigger": { "id": 1, "name": "Inactive Users", "description": "Fires when there are users inactive for more than 60 days. These users will recieve email. There is no need to add mail campaign, just attach this trigger to a template." }, "accessWarnings": [] } ] } }
The general response properties are described on the Response format page. Here are the list of the specific properties for this method.
property | value | description |
---|---|---|
id | integer | the id of the record |
subject | string | the subject of the emails generated by the campaign |
content | string | the content of the emails generated by the campaign |
statusId | integer | the id of the current campaign status as follows:
|
statusName | string | human readable description of the campaign state |
group | object | some common properties of the group in which the record was created: id, name, slug, thumbUrl, url (of the group home page) |
campaignGroup | object | The selected recipients group by the campaign described by its id, name and description. Alternative to the "userRole" selection. Could be "null" if the user role option is selected for this campaign |
userRole | string | Instead of using a pre-filled campaign group of recipients, send the emails to all members with the selected user role. The object is defined with the role Id and name. Could be "null" if the campaign group option is selected for this campaign. |
trigger | object | The selected automatic trigger of the campaign. It is null if no trigger is selected and the campaign could be triggered only manually. This is the property that separates the Manually sent campaign from the Auto triggered campaigns. |
Method: create
Authorization is required.
Request
HTTP request
POST https://<YOUR_DOMAIN>/api/v1/en_US/campaign
Parameters
Do not supply a request parameters with this method.
Request body
property | value | description |
---|---|---|
groupId | guid | In which group to create the record |
subject | string | the subject of the emails generated by the campaign |
content | string | the content of the emails generated by the campaign |
sendOn | date | When the campaign should be started in ISO 8601 string format and UTC time zone |
statusId | integer | the id of the current campaign status as follows:
|
recipients | string | Id of the recipient group, as follows:
|
triggerId | integer | The id of the automatic trigger. The trigger Id is provided only when the campaign is automatically triggered. If this is a manually started campaign, the trigger Id should be null. |
Response
If successful, this method returns a response JSON with the following structure:
{ "timestamp": "2014-03-03T23:20:23Z", "success": true, "message": "Aliqua anim consequat amet cupidatat proident amet amet.", "errors": [ { "key": "subject", "value": "", "message": "subject cannot be blank" } ], "object": { "id": 2, "type": "campaign", "subject": "Campaign #111 subject", "content": "Campaign #111 content", "sendOn": "2014-03-22T23:20:23Z", "statusId": 1, "statusName": "pending", "group": { "id": "83acbf0f-b920-4ecb-a61e-e85bbfaaa52f", "name": "ea", "slug": "Home", "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png", "url": "http://demo.hivesocialnow.com/Home/" }, "campaignGroup": null, "userRole": { "id": 2, "name": "regular" }, "trigger": null, "accessWarnings": [] } }
The general response properties are described on the Response format page. Here are the list of the specific properties for this method.
property | value | description |
---|---|---|
For property description look in the table above |
Method: update
Authorization is required.
Request
HTTP request
PUT https://<YOUR_DOMAIN>/api/v1/en_US/campaign/{campaignId}
Parameters
property | value | description |
---|---|---|
campaignId | integer | In id of the updated record |
Request body
property | value | description |
---|---|---|
subject | string | the subject of the emails generated by the campaign |
content | string | the content of the emails generated by the campaign |
sendOn | date | When the campaign should be started in ISO 8601 string format and UTC time zone |
statusId | integer | the id of the current campaign status as follows:
|
recipients | string | Id of the recipient group, as follows:
|
triggerId | integer | The id of the automatic trigger. The trigger Id is provided only when the campaign is automatically triggered. If this is a manually started campaign, the trigger Id should be null. |
Response
If successful, this method returns a response JSON with the following structure:
{ "timestamp": "2014-03-03T23:20:23Z", "success": true, "message": "Aliqua anim consequat amet cupidatat proident amet amet.", "errors": [ { "key": "subject", "value": "", "message": "subject cannot be blank" } ], "object": { "id": 2, "type": "campaign", "subject": "Campaign #111 subject", "content": "Campaign #111 content", "sendOn": "2014-03-22T23:20:23Z", "statusId": 1, "statusName": "pending", "group": { "id": "83acbf0f-b920-4ecb-a61e-e85bbfaaa52f", "name": "ea", "slug": "Home", "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png", "url": "http://demo.hivesocialnow.com/Home/" }, "campaignGroup": null, "userRole": { "id": 2, "name": "regular" }, "trigger": null, "accessWarnings": [] } }
The general response properties are described on the Response format page. Here are the list of the specific properties for this method.
property | value | description |
---|---|---|
For property description look in the table above |
Method: delete
Authorization is required.
Request
HTTP request
DELETE https://<YOUR_DOMAIN>/api/v1/en_US/campaign/{campaignId}
Parameters
property | value | description |
---|---|---|
campaignId | integer | In id of the deleted record |
Request body
Do not supply a request body with this method.
Response
If successful, this method returns a response JSON with the following structure:
{ "timestamp": "2014-03-03T23:20:23Z", "success": true, "message": "Aliqua anim consequat amet cupidatat proident amet amet.", "errors": [ { "key": "subject", "value": "", "message": "subject cannot be blank" } ], "object": { "id": 2, "type": "campaign", "subject": "Campaign #111 subject", "content": "Campaign #111 content", "sendOn": "2014-03-22T23:20:23Z", "statusId": 1, "statusName": "pending", "group": { "id": "83acbf0f-b920-4ecb-a61e-e85bbfaaa52f", "name": "ea", "slug": "Home", "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png", "url": "http://demo.hivesocialnow.com/Home/" }, "campaignGroup": null, "userRole": { "id": 2, "name": "regular" }, "trigger": null, "accessWarnings": [] } }
The general response properties are described on the Response format page. Here are the list of the specific properties for this method.
property | value | description |
---|---|---|
id | integer | the id of the record |
subject | string | the subject of the emails generated by the campaign |
content | string | the content of the emails generated by the campaign |
statusId | integer | the id of the current campaign status as follows:
|
statusName | string | human readable description of the campaign state |
group | object | some common properties of the group in which the record was created: id, name, slug, thumbUrl, url (of the group home page) |
campaignGroup | object | The selected recipients group by the campaign described by its id, name and description. Alternative to the "userRole" selection. Could be "null" if the user role option is selected for this campaign |
userRole | string | Instead of using a pre-filled campaign group of recipients, send the emails to all members with the selected user role. The object is defined with the role Id and name. Could be "null" if the campaign group option is selected for this campaign. |
trigger | object | The selected automatic trigger of the campaign. It is null if no trigger is selected and the campaign could be triggered only manually. This is the property that separates the Manually sent campaign from the Auto triggered campaigns. |