User Tools

Site Tools


api:auth

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
api:auth [2016/07/12 09:47]
Jochen Linnemann created
api:auth [2016/09/18 12:07]
Jochen Linnemann spelling correction
Line 1: Line 1:
 ====== Authentication ====== ====== Authentication ======
  
-To authenticate to the API endpoints you need to define ​to header entries in every request+To authenticate to the API endpoints you need to define ​two header entries in every request
  
   * CL-Username   * CL-Username
Line 8: Line 8:
 and provide your credentials in plain text - as we use HTTPS they get encrypted automatically on their way through the net. and provide your credentials in plain text - as we use HTTPS they get encrypted automatically on their way through the net.
  
-===== Example =====+===== 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); 
 + });
  
  
api/auth.txt · Last modified: 2016/09/18 12:07 by Jochen Linnemann