The CreativeX Content API uses access tokens to authenticate requests. Once an API token is issued, you can use it in the request body as the access_token
parameter.
require 'net/http'
require 'rest_client'
require 'uri'
require 'json'
def access_token
'def456'
end
def base_url
'https://api.creativex.com/api/v3'
end
def url(path, params)
"#{base_url}#{path}?#{URI.encode_www_form(params)}"
end
def preflight_detail(id)
params = { access_token: access_token }
path = '/preflights/#{id}'
uri = URI(url(path, params))
res = Net::HTTP.get_response(uri)
URI.parse(JSON.parse(res.body))
end
$ curl https://api.creativex.com/api/v3/preflights/abc123?access_token=def456
For authenticated endpoints, failing to provide an access token in the request body will result in a 401 response. All endpoints are authenticated, with the exception of the healthz
endpoint.
Starting with v3.0.0, organizations can have multiple access tokens. Access tokens should be kept secret because they provide access to privileged information—keep them out of your client side code!
If you don't have an access token and you need one, please email [email protected].