User Tools

Site Tools


api:crud-logs

CRUD Logs

This API is protected, see Authentication.

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

Create Logs

Create a new log

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

Request Body: JSON

{
  "name": "Name of the new log"
}

Response Body: JSON

{
  "id": "id of new log",
  "rev": "first revision of new log",
  "name": "name of new log"
}

Read Logs

Get a list of all your logs

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

Request Body: empty

Response Body: JSON

[
  {
    "id": "id of log #1",
    "rev": "current revision of log #1",
    "name": "name of log #1"
  },
  {
    "id": "...",
    "rev": "...",
    "name": "..."
  },
  {
    "id": "id of log #n",
    "rev": "current revision of log #n",
    "name": "name of log #n"
  }
]

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 + " log(s)");
}, function (jqXHR, status, error) {
	// failure
	alert("Error: " + error);
});

Get one existing log

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

Request Body: empty

Response Body: JSON

{
  "id": "id of log",
  "rev": "current revision of log",
  "name": "name of log"
}

Update Logs

Update an existing log

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

Request Body: JSON

{
  "rev": "current revision of log",
  "name": "New name of log"
}

Response Body: JSON

{
  "id": "id of log",
  "rev": "new revision of log",
  "name": "name of log"
}

Delete Logs

Delete a log

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

Request Body: empty

Response Body: JSON

{
  "id": null,
  "rev": null,
  "name": null
}
api/crud-logs.txt · Last modified: 2017/10/28 19:16 by Jochen Linnemann