User Tools

Site Tools


api:crud-log-entries

CRUD Log Entries

This API is protected, see Authentication.

Old endpoints are available since January 2017, new endpoints are available since November 2017.

Create Log Entries

Create a new log entry

Method: POST
New Endpoint Address: https://campaign-logger.com/gateway/rest/public/log/{log-id}/entry

Request Body: JSON

{
  "rawText": "text as entered by user",
  "timestamp": "yyyy-MM-ddThh:mm:ss",
  "uniqueId": "anything uniquely identifying this entry among all entries that might ever exist"
}

Response Body: JSON

{
  "id": "id of new log entry",
  "rev": "first revision of new log entry",
  "rawText": "text as entered by user",
  "timestamp": "yyyy-MM-ddThh:mm:ss",
  "uniqueId": "anything uniquely identifying this entry among all entries that might ever exist",
  "htmlText": "rawText rendered to HTML",
  "tags": [
    "@Name A",
    "#Place B",
    "..."
  ]
}

Read Log Entries

Get all entries of one of your logs

Method: GET
Old Endpoint Address: https://campaign-logger.com/gateway/rest/public/logs/{log-id}
New Endpoint Address: https://campaign-logger.com/gateway/rest/public/log/{log-id}/entry

Request Body: empty

Response Body: JSON

[
  {
    "id": "id of log entry #1",
    "rev": "current revision of log entry #1",
    "rawText": "text as entered by user",
    "timestamp": "yyyy-MM-ddThh:mm:ss",
    "uniqueId": "anything uniquely identifying this entry among all entries that might ever exist",
    "htmlText": "rawText rendered to HTML",
    "tags": [
      "@Name A",
      "#Place B",
      "..."
    ]
  },
  {
    "id": "...",
    "rev": "...",
    "rawText": "...",
    "timestamp": "...",
    "uniqueId": "...",
    "htmlText": "...",
    "tags": [
      "..."
    ]
  },
  {
    "id": "id of log entry #n",
    "rev": "current revision of log entry #n",
    "rawText": "text as entered by user",
    "timestamp": "yyyy-MM-ddThh:mm:ss",
    "uniqueId": "anything uniquely identifying this entry among all entries that might ever exist",
    "htmlText": "rawText rendered to HTML",
    "tags": [
      "@Name C",
      "#Place D",
      "..."
    ]
  }
]

Example using jQuery

$.ajax("https://campaign-logger.com/gateway/rest/public/logs/...", {
	dataType: "json",
	headers: {
		"CL-Username": "...",
		"CL-Password": "..."
	},
	type: "GET"
}).then(function (data, status, jqXHR) {
	// success
	alert("Found " + data.length + " entries");
}, function (jqXHR, status, error) {
	// failure
	alert("Error: " + error);
});

Get one entry of one of your logs

Method: GET
New Endpoint Address: https://campaign-logger.com/gateway/rest/public/log/{log-id}/entry/{entry-id}

Request Body: empty

Response Body: JSON

{
  "id": "id of log entry",
  "rev": "current revision of log entry",
  "rawText": "text as entered by user",
  "timestamp": "yyyy-MM-ddThh:mm:ss",
  "uniqueId": "anything uniquely identifying this entry among all entries that might ever exist",
  "htmlText": "rawText rendered to HTML",
  "tags": [
    "@Name A",
    "#Place B",
    "..."
  ]
}

Update Log Entries

Update an existing log entry

Method: PUT
New Endpoint Address: https://campaign-logger.com/gateway/rest/public/log/{log-id}/entry/{entry-id}

Request Body: JSON

{
  "rev": "current revision of log entry",
  "rawText": "text as entered by user",
  "timestamp": "yyyy-MM-ddThh:mm:ss",
  "uniqueId": "anything uniquely identifying this entry among all entries that might ever exist"
}

Response Body: JSON

{
  "id": "id of log entry",
  "rev": "new revision of log entry",
  "rawText": "text as entered by user",
  "timestamp": "yyyy-MM-ddThh:mm:ss",
  "uniqueId": "anything uniquely identifying this entry among all entries that might ever exist",
  "htmlText": "rawText rendered to HTML",
  "tags": [
    "@Name A",
    "#Place B",
    "..."
  ]
}

Delete Log Entries

Delete one entry of one of your logs

Method: DELETE
New Endpoint Address: https://campaign-logger.com/gateway/rest/public/log/{log-id}/entry/{entry-id}

Request Body: empty

Response Body: JSON

{
  "id": null,
  "rev": null,
  "rawText": null,
  "timestamp": null,
  "uniqueId": null,
  "htmlText": null,
  "tags": null
}
api/crud-log-entries.txt · Last modified: 2017/10/28 19:40 by Jochen Linnemann