Campaigns

Available methods

All available methods for resource campaigns.

HTTP method Endpoint Description
[badge-blue GET] /campaigns Get information about all campaigns
[badge-blue GET] /campaigns/{campaign_id} Get information about a campaign
[badge-green POST] /campaigns/{campaign_id} Create a new campaign

Collection of campaigns

Get information about all available campaigns
[badge-blue GET] /campaigns

Query string

Parameter name Type Description Mandatory (Yes/No)
count integer The number of records to return.
Default value is 100.
No
offset integer The number of records from a collection to skip.
Default value is 0.
No
sort_field string One of the query string parameters for sorting.
Response is sorted by the specified field.
No
sort_direction string Direction of sorting the response list.
Possible values are: ASC / DESC
No
name string Name of the campaign No

Response

Status code: 200 OK
Output structure : object

Parameter name Type Description
campaigns Campaign[] List of the campaigns
total_items integer Count of all found campaigns

Example request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/campaigns?name=REST%20campaign
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZWgEmEyZGFjZ3NmUzNDljNGYyMzlkOWQ0NA==

Example response

HTTP/1.1 200 OK
Date: Tue, 04 Aug 2020 10:13:02 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "campaigns": [
      {
        "idcampaign": "8edebb6b9d299c59804b2aa812",
        "name": "REST campaign",
        "last_change": "2019-10-24 19:09:30",
        "parent_id": "8fd17bf437555cf56a6ecf05fc",
        "external_id": "288684441",
        "state": 1
      },
      {
        "idcampaign": "8cdb0cd36e7fef61a4ff7297f3",
        "name": "REST campaign",
        "last_change": "2019-10-24 19:26:31",
        "parent_id": "8fd17bf437555cf56a6ecf05fc",
        "external_id": "965257070",
        "state": 1
      },
      {
        "idcampaign": "85d85ccae1fbb739f0a6d4b02b",
        "name": "REST campaign",
        "last_change": "2019-10-25 10:25:55",
        "parent_id": "8fd17bf437555cf56a6ecf05fc",
        "external_id": "92100038",
        "state": 1
      },
      {
        "idcampaign": "8fd5ac6641361255defa0d64c0",
        "name": "REST campaign",
        "last_change": "2019-10-29 15:18:53",
        "parent_id": "8fd17bf437555cf56a6ecf05fc",
        "external_id": "737569921",
        "state": 1
      },
      {
        "idcampaign": "82d2fcd73b80dd77944bf8046c",
        "name": "Test REST campaign",
        "last_change": "2019-10-29 16:47:51",
        "parent_id": "83d1d11ea3884a5d33253fe214",
        "external_id": "ext_id",
        "state": 1
      }
    ],
    "total_items": 5
  }
}


Detail of a specific campaign

Get information about all details of a specific campaign
[badge-blue GET] /campaigns/{campaign_id}

Path parameters

Parameter name Type Description
campaign_id string The unique id for the campaign in CareCloud

Response

Status code: 200 OK
Output structure : Campaign

Example request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/campaigns/81eaeea13b8984a169c490a325
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZWgEmEyZGFjZ3NmUzNDljNGYyMzlkOWQ0NA==

Example response

HTTP/1.1 200 OK
Date: Tue, 04 Aug 2020 10:16:41 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "idcampaign": "81eaeea13b8984a169c490a325",
    "name": "REST campaign",
    "last_change": "2019-10-17 10:13:23",
    "parent_id": null,
    "external_id": null,
    "state": 1
  }
}


Create a campaign

Add a new campaign
[badge-green POST] /campaigns

Request

Parameter name Type Description Mandatory (Yes/No)
campaign Campaign Campaign resource Yes

Response

Status code: 201 Created
Output structure : object

Parameter name Type Description
campaign_id string The unique id of the campaign

Example request

POST https://<projectURL>/rest-api/enterprise-interface/v1.0/campaigns
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZV9pbnERlcmZhY2U6M2ViYTg1MY0NjZlNTdkYThkMDdhYjg2Y2MzNGQ3MTFmMWIyNTgxOTIyMjMwNDE4ZTM5YjFlNjNhMGJkNWQ2ZA==

{
  "campaign" : {
    "external_id": "987940537",
    "parent_id" : "8fd17bf437555cf56a6ecf05fc",
    "name": "REST ecampaign"
  }
}

Example response

HTTP/1.1 201 Created
Date: Tue, 04 Aug 2020 10:21:23 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "campaign_id": "8ddf3d4e2586a590ac8162d3f4"
  }
}