Authentication

The CreativeX Authentication Logging API uses access tokens to authenticate requests. Once an API token is issued, you can submit it as a Bearer Token in the headers. Failing to provide an access token in the headers will result in a 401 error response. Here's some example code:

require 'httparty'

def access_token
  'def456'
end

def base_url
  'https://api.creativex.com/auth_logging/v1'
end

def log_data
  path = '/log/data'
  headers = {
    "Authorization" => "Bearer #{token}",
    "Content-Type" => "application/json"
  }

  url = "#{base_url}#{path}"
	response = HTTParty.get(url, headers: headers)
	response.body
end