POST https://app.cartelux.com/api/oauth/token

Fetch a new token for your app, in order to make further requests to the cartelux API

Parameters
app_id The identifier of the app within the API product
app_secret The secret associated with the app.
Example request
curl -X POST -u "{app_id}:{app_secret}" -d "grant_type=client_credentials" https://app.cartelux.com/api/oauth/token
Example response
{"token_type":"Bearer","expires_in":31536000,"access_token":"udp2HpsGt8xlm..........Hwoc1w6SYFIFQKxRk4mNJrh3"}

POST https://app.cartelux.com/api/v1.0/account/company/account/payment/check

Check whether an amount will work on the company account

Parameters
amount The amount of the payment
Example request
curl -X POST -H "Authorization: Bearer {access_token}" -H "Content-Type: application/json" --data '
{
    "amount": -123.45
}' https://app.cartelux.com/api/v1.0/account/company/account/payment/check

GET https://app.cartelux.com/api/v1.0/account/company/{all}/{inherit}

Return the company that this app belongs to

Parameters
all Optional, return all associated companies
inherit Optional, apply inheritance rule to all associated companies (Note - this will heavily impact response time)
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/account/company/{all?}/{inherit?}
Example response
{"name":"Your company name","domain":"cartelux.com","address":"42 Wallaby Way","country":"Australia","state":"NSW","city":"Sydney","postcode":"2000","phone":"8675309","language":"english","code":1344,"api_dealer_id":1344}

GET https://app.cartelux.com/api/v1.0/account/company/account

Return the details of the company account

Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/account/company/account

POST https://app.cartelux.com/api/v1.0/account/company/user/create

Create (or update the details of) a linked user.

Example request
curl -X POST -H "Authorization: Bearer {access_token}" -H "Content-Type: application/json" --data '
{
    "name": "John Smith",
    "email": "john@gmail.com",
    "appearance": {
        "logo": "https://www.somewhere.com/logo.jpg",
        "primary_colour": "#FF2F3C",
        "secondary_colour": "#CCFF22"
    }
}' https://app.cartelux.com/api/v1.0/account/company/user/create

GET https://app.cartelux.com/api/v1.0/marketing/orders/{api_dealer_id}

List the orders within a company

Parameters
api_dealer_id Optional, the id matching the 'api-dealer-id' attachment against the company
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/marketing/orders/{api_dealer_id}
Example response
[{"id":1977,"order_number":"TOYOTATHAI00005","name":"พิธานพาณิชย์ สาขานราธิวาส Camry 2022-09-08","start_date":"2022-08-24","end_date":"2022-08-31","status":250,"order_id":1977,"status_name":"Completed","code":14999,"api_dealer_id":"14999"}]

GET https://app.cartelux.com/api/v1.0/marketing/order/{id}

Detailed information about a specific order

Parameters
id the id of the order in the marketing product
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/marketing/order/{id}

GET https://app.cartelux.com/api/v1.0/marketing/order/{id}/status

Fetch the status of the specific order

Parameters
id the id of the order in the marketing product
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/marketing/order/{id}/status

GET https://app.cartelux.com/api/v1.0/marketing/order/{id}/preview

Lists all the videos for preview

Parameters
id the id of the order in the marketing product
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/marketing/order/{id}/preview

PATCH https://app.cartelux.com/api/v1.0/marketing/order/{id}/approve{/check}

Checks/Sets an order as approved so it can move on to the next stage

Parameters
id the id of the order in the marketing product
check Optional - check whether the order can be approved or if there's any issues.
amount The dollar amount for the order.
stripe_payment_id Optional - a stripe payment id that matches the order amount, for recouping the cost.
Example request
curl -X PATCH -H "Authorization: Bearer {access_token}" -H "Content-Type: application/json" --data '
{
    "amount": 123,
    "stripe_payment_id": "py_.............."
}' https://app.cartelux.com/api/v1.0/marketing/order/{id}/approve{/check}

PATCH https://app.cartelux.com/api/v1.0/marketing/order/{id}/remove

Sets an order as removed - cancels an order

Parameters
id the id of the order in the marketing product
Example request
curl -X PATCH -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/marketing/order/{id}/remove

GET https://app.cartelux.com/api/v1.0/marketing/analytics/{order_id}/{channel?}?breakdown_by={breakdown_by}&start_date={start_date}&end_date={end_date}

List analytics of an order

Parameters
order_id the id of the order in the marketing product
channel Optional - which channel to fetch analytics for eg. google_video, google_display, google_search
breakdown_by Optional, return the analytics for a specific segment eg. gender, overall, age, device, country, region, network, parental
start_date the start date of the analytics to return (inclusive) eg. 2022-05-21
end_date the end date of the analytics to return (inclusive) eg. 2022-05-27
Example request
curl -X GET -H "Authorization: Bearer {access_token}" "https://app.cartelux.com/api/v1.0/marketing/analytics/{order_id}/{channel?}?breakdown_by={breakdown_by}&start_date={start_date}&end_date={end_date}"
Example response
[{"count":1,"week":24,"year":2022,"video_played_to_25_percent":"95","video_played_to_50_percent":"72","video_played_to_75_percent":"57","video_played_to_100_percent":"46","views":"251","view_rate":"0.45","impressions":"560","clicks":"0","ctr":"0.00","created":"2022-06-18"}]

GET https://app.cartelux.com/api/v1.0/marketing/google_campaign/{order_id}/{channel?}?start_date={start_date}&end_date={end_date}

List analytics of an order

Parameters
order_id the id of the order in the marketing product
channel Optional - which channel to fetch analytics for eg. video, display, search
start_date Optional - the start date of the analytics to return (inclusive) eg. 2022-05-21
end_date Optional - the end date of the analytics to return (inclusive) eg. 2022-05-27
Example request
curl -X GET -H "Authorization: Bearer {access_token}" "https://app.cartelux.com/api/v1.0/marketing/google_campaign/{order_id}/{channel?}?start_date={start_date}&end_date={end_date}"
Example response
[{"order_id":1977,"car_model":"Camry","duration":8,"campaign_type":"VIDEO","location":["{key:21025,value:Bangkok,Thailand}","{key:9074384,value:Bang Phli Noi,Samut Prakan,Thailand}","{key:9074393,value:Ban Sing,Ratchaburi,Thailand}","{key:9074394,value:Bang Krabue,Pathum Thani,Thailand}","{key:9074400,value:Bang Krachao,Samut Sakhon,Thailand}"],"keywords":["ศูนย์ โตโยต้าใกล้ฉัน","ศูนย์ โตโยต้า ใกล้ ฉัน","ศูนย์ โตโยต้า ใกล้ ที่สุด","ศูนย์ โตโยต้า ขาย แท็กซี่","ศูนย์ โตโยต้า เปิด กี่ โมง","ศูนย์ โตโยต้า เปิด ทุก วัน","ศูนย์ โตโยต้า เปิด วัน อาทิตย์","ศูนย์ โตโยต้า เปิด ใหม่","ดีลเลอร์โตโยต้า นราธิวาส","Toyota dealer นราธิวาส","ติดต่อ ศูนย์ โตโยต้า [CITY]","โปรโมชั่น โตโยต้า [STATE]","camry [STATE]","แคม รี่","toyota camry มือ สอง","camry ราคา","คั ม รี่","โต โย ต้า แคม รี่","camry 2.5","toyota camry ราคา","คั ม รี่ 2021","camry 2021 ราคา","toyota camry 2021 ราคา","ราคา camry","ราคา แคม รี่","โต โย ต้า camry","ราคา camry 2021","แคม รี่ 2021","ราคา toyota camry","แคม รี่ ราคา","camry hybrid ราคา","camry 2021 pantip","แคม รี่ แต่ง","แคม มา รี่","camry แต่ง สวย","camry ทุก โฉม","camry pantip","camry esport","แคม รี่ ตัว ใหม่","ราคา โต โย ต้า แคม รี่","โต โย ต้า คั ม รี่ ราคา","toyota camry 2021 รีวิว","แคม รี่ ใหม่","แคม รี่ แต่ง สวย","camry ตัว ใหม่","toyota camry แต่ง","คั ม รี่ 2022","แคม ม รี่","แคม รี่ สี ดำ","camryclub","โต โย ต้า แคม รี่ ราคา","camry hybrid 2021 รีวิว","camry ภายใน","toyota camry ภายใน","โต โย ต้า แคม รี่ 2021","camry 2022 ราคา","toyota camry 2022 ราคา","camry 2022 pantip","แคม รี ไฮ บ ริ ด","camry แต่ง สวย vip","camry 2022 รีวิว","camry 2.5 2021","toyota camry toyota camry","camry v6 3.5","toyota camry 2.4 v ดี ไหม","ราคา คั ม รี่ 2021","camry 2.0 g ราคา","toyota camry pris","camry รีวิว","ราคา camry hybrid","toyota camry pantip","camry 2.5 g pantip","โต โย ต้า camry 2021","camry 2.5 g ราคา","toyota คั ม รี่","ราคา toyota camry 2021","คั ม รี่ ราคา","toyota camry hybrid ราคา","แคม รี่ คลับ","ราคา คั ม รี่","camry 2021 รีวิว","toyota camry รีวิว","camry 2021 2.5","คั ม รี่ ไม้บรรทัด","camry ใหม่","แคม รี่ acv40","camry 2.5 g รีวิว","2022 toyota camry 2021 toyota camry","คั ม รี่ แต่ง สวย","camry ลด 2 แสน","รีวิว camry","camry 2.0 g รีวิว","แคม รี่ 2.5","camry ส่วนลด เงินสด 2021 pantip","camry 2021 3.5","toyota camry hybrid รีวิว","แคม มิ รี่","คั ม รี่ 2.5 g","แคม รี่ acv30","camry 2.4 v รีวิว","รีวิว toyota camry"],"audience":["{key:92945,value:Travel}","{key:92924,value:Business Travelers}","{key:91500,value:Travel Buffs}","{key:91504,value:Beachbound Travelers}","{key:91502,value:Family Vacationers}","{key:91501,value:Luxury Travelers}","{key:91505,value:Snowbound Travelers}","{key:80097,value:Motor Vehicles (New)}","{key:80178,value:Hybrid & Alternative Vehicles (New)}","{key:80179,value:Luxury Vehicles (New)}"],"budget":"9680000","bidding":"MANUAL_CPV","ad_assets":[{"media":"https://www.youtube.com/watch?v=zQ1JB9TplgM","thumbnail":"https://test-toyota-th.cartelux.com/marketing/media/e7/ad/76/88/e7ad7688-3488-41f1-b1db-305b6e56c29a.jpg"}],"total_cost":"9427931","impressions":"538","engagements":"174","video_views":"128","video_views_25":125,"video_views_25_rate":0.9781021897810219,"video_views_50":64,"video_views_50_rate":0.5054744525547445,"video_views_75":40,"video_views_75_rate":0.31386861313868614,"video_views_100":29,"video_views_100_rate":0.23357664233576642,"clicks":"1","quality_score":"","cpm":17524035.31598513,"cpe":54183.511494252874,"cpv":73655.7109375,"cpc":9427931,"cpa":"","cpp":"","reach":"","er":0.32342007434944237,"vtr":0.2379182156133829,"ctr":0.0018587360594795538,"ad_name":"In Market 30s","ad_id":"617187046727","ad_group_name":"In Market","ad_group_id":"147023434744","campaign_name":"Toyota Test Campaign #1977","campaign_id":"18082355028","start_date":"2022-08-25","end_date":"2022-08-25","code":"14999","api_dealer_id":"14999"}]

POST https://app.cartelux.com/api/v1.0/marketing/order/create

Create a new order within the marketing product.

Parameters
start_date yyyy-mm-dd (2020-02-02)
end_date yyyy-mm-dd (2020-02-05)
cta This determines the button text and header text for your ad. Valid options are: BOOK_TRAVEL, CONTACT_US, DONATE, DONATE_NOW, DOWNLOAD, GET_DIRECTIONS, GO_LIVE, INTERESTED, LEARN_MORE, LIKE_PAGE, MESSAGE_PAGE, SAVE, SEND_TIP, SHOP_NOW, SIGN_UP, VIEW_INSTAGRAM_PROFILE, INSTAGRAM_MESSAGE, LOYALTY_LEARN_MORE, GET_MOBILE_APP, INSTALL_MOBILE_APP, USE_MOBILE_APP, INSTALL_APP, USE_APP, PLAY_GAME, WATCH_VIDEO, WATCH_MORE, OPEN_LINK, NO_BUTTON, LISTEN_MUSIC, MOBILE_DOWNLOAD, GET_OFFER, GET_OFFER_VIEW, BUY_NOW, BUY_TICKETS, UPDATE_APP, BET_NOW, ADD_TO_CART, ORDER_NOW, SELL_NOW, GET_SHOWTIMES, LISTEN_NOW, GET_EVENT_TICKETS, SEARCH_MORE, PRE_REGISTER, BOOK_TEST_DRIVE, CHECK_AVAILABILITY, CALL, MISSED_CALL, CALL_NOW, CALL_ME, APPLY_NOW, BUY, GET_QUOTE, SUBSCRIBE, RECORD_NOW, VOTE_NOW, GIVE_FREE_RIDES, REGISTER_NOW, OPEN_MESSENGER_EXT, EVENT_RSVP, CIVIC_ACTION, SEND_INVITES, REQUEST_TIME, SEE_MENU, WHATSAPP_MESSAGE, SEARCH, TRY_IT, TRY_ON, LINK_CARD, DIAL_CODE, FIND_YOUR_GROUPS
fields Where all the random data sits that was sent through via a form.
landing_page
user_id The social token user identifier for export channels
headline
subheadline
description
disclaimer
logo
primary_colour
secondary_colour
video_template_id The template_id that should be used for the video
channels All the export channel selections and overrides
video_overrides All the overrides to be used in the video product
Example request
curl -X POST -H "Authorization: Bearer {access_token}" -H "Content-Type: application/json" --data '
{
    "template_id": 19,
    "fields": {
        "start_date" : "2020-02-12",
        "end_date" : "2020-02-13",
        "landing_page": "https://google.com",
        "agent_name": "bob loblaw",
        "agent_number": "12345678",
        "franchise": "McGrath",
        "logo": "https://something.com/image.jpg",
        "headshot": "https://something.com/headshot.jpg",
        "primary_colour": "#FFCCDDAA",
        "secondary_colour": "#00FF00AA",
        "background_image": "https://something.com/background.jpg",
        "headline": "fantastic ad",
        "desc": "this is a description",
        "user_id": "12",
        ...
    },
    "video_overrides": {
        "chart": {
            "name": "Property Sales",
            "visible": 1,
            "start": 1.00,
            "options": {
                "labels": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" ],
                "datasets": [
                    {
                        "label": "Mean average",
                        "data": [ 15, 3, 7, 19, 21 ]
                    }
                ]
            ]
        },
        "background": {
            "file": "{{ $fields[background_image] }}"
        },
        "agent-name": {
            "text": "{{ fields[agent_name] }}"
        },
        "agency": {
            "text": "{{ $fields[franchise] }}",
        },
        "logo": {
            "file": "{{ fields[logo] }}",
        },
        ...
    },
    "channels": [
        {
            "cta": "WATCH_MORE", 
            "type": "video", 
            "device": "mobile", 
            "target": "facebook_ad", 
            "max_age": 65,  // optional
            "min_age": 13,  // optional
            "page_id": "110401823694019", 
            "countries": ["AU", "JP"], 
            "regions": [{"key": "3886"}],  
            "cities": [{"key": "777934"}], // optional
            "behaviors": [{"id": "6002714895372", "name": "All travelers"}],  // optional
            "interests": [{"id": "6003139266461", "name": "Movies"}, {"id": "6003397425735", "name": "Tennis"}],  // optional
            "languages": "[1001,1005]",  // optional
            "user_uuid": "uuid5553", 
            "industries": [{"id": "6009003307783", "name": "Accounting and finance"}, {"id": "6012903168383", "name": "Community and social services"}],  // optional 
            "life_events": [{"id": "6003054185372", "name": "Recently Moved"}],  // optional
            "daily_budget": 1.05, 
            "optimization_goal": "THRUPLAY",  // optional
            "billing_event" : "THRUPLAY",  // optional
            "video_thumbnail" : "https://www.test.com/test.jpg"
        },
        {
            "target": "instagram_post",
            "type": "video",
            "user_uuid": "{{ $fields[user_uuid] }}",
            "caption": "{{ $fields[headline] }}"
        },
        ...
    ]
}' https://app.cartelux.com/api/v1.0/marketing/order/create

GET https://app.cartelux.com/api/v1.0/io/analytics/{protocol_shortcode}/{campaign_id}/{timeframe}?breakdown_by={breakdown_by}

Fetch the analytics for a given campaign id

Parameters
protocol_shortcode the identifier of the protocol for which the languages belong
campaign_id which campaign to fetch analytics for (facebook/google/etc campaign id, not order id)
breakdown_by Optional, return the analytics for a specific segment eg. gender
timeframe today, yesterday, etc.
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/analytics/{protocol_shortcode}/{campaign_id}/{timeframe}?breakdown_by={breakdown_by}

GET https://app.cartelux.com/api/v1.0/io/languages/{protocol_shortcode}

Lists all the languages available for the given protocol

Parameters
protocol_shortcode the identifier of the protocol for which the languages belong
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/languages/{protocol_shortcode}

GET https://app.cartelux.com/api/v1.0/io/interests/{protocol_shortcode}

Lists all the interests available for the given protocol

Parameters
protocol_shortcode the identifier of the protocol for which the interests belong
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/interests/{protocol_shortcode}

GET https://app.cartelux.com/api/v1.0/io/behaviors/{protocol_shortcode}

Lists all the behaviors available for the given protocol

Parameters
protocol_shortcode the identifier of the protocol for which the behaviors belong
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/behaviors/{protocol_shortcode}

GET https://app.cartelux.com/api/v1.0/io/life_events/{protocol_shortcode}

Lists all the life events available for the given protocol

Parameters
protocol_shortcode the identifier of the protocol for which the life events belong
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/life_events/{protocol_shortcode}

GET https://app.cartelux.com/api/v1.0/io/industries/{protocol_shortcode}

Lists all the industries available for the given protocol

Parameters
protocol_shortcode the identifier of the protocol for which the industries belong
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/industries/{protocol_shortcode}

GET https://app.cartelux.com/api/v1.0/io/countries/{protocol_shortcode}

Lists all the countries available for the given protocol

Parameters
protocol_shortcode the identifier of the protocol for which the countries belong
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/countries/{protocol_shortcode}

GET https://app.cartelux.com/api/v1.0/io/regions/{country_code}/{protocol_shortcode}

Lists all the regions available for the given protocol and country

Parameters
protocol_shortcode the identifier of the protocol for which the regions belong
country_code the identifier of the country for which the regions belong
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/regions/{country_code}/{protocol_shortcode}

GET https://app.cartelux.com/api/v1.0/io/cities/{country_code}/{city}/{protocol_shortcode}

Lists all the cities available for the given protocol, country, and region

Parameters
protocol_shortcode the identifier of the protocol for which the cities belong
country_code the identifier of the country for which city belongs
city the city name
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/cities/{country_code}/{city}/{protocol_shortcode}

GET https://app.cartelux.com/api/v1.0/io/user/{user_id}/pages/{protocol_shortcode}

Lists all the pages available under the user identified by user_id for the given protocol

Parameters
protocol_shortcode the identifier of the protocol for which the pages belong
user_id user id of the user that has been created on our system
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/user/{user_id}/pages/{protocol_shortcode}
Example response
[
    {"id":"25503515529","name":"Alterior Motif"},
    {"id":"183002118090","name":"Ray White Maroochydore"},
    {"id":"100120318062021","name":"Test page with different account"},
    {"id":"142651759151162","name":"Cartelux"},
    {"id":"296094457157291","name":"Adelaide Solar Systems"},
    {"id":"360389530813590","name":"Keystar Autoworld Kippa-Ring"},
    {"id":"375630559265797","name":"autoreviewa.com.au"},
    {"id":"387492907985754","name":"Springwood Nissan"},
    {"id":"390009897792085","name":"Austral Volkswagen"},
    {"id":"408194149237393","name":"Rockdale Volkswagen"},
    {"id":"808588789151780","name":"Coastline BMW"},
    {"id":"1034363999931303","name":"Pacific Isuzu UTE"},
    {"id":"1582687365336568","name":"Solahart Riverina - Junee Plumbing"},
    {"id":"1698642160401215","name":"Toowoomba BMW"}
]

GET https://app.cartelux.com/api/v1.0/io/user/{id}/check/{protocol_shortcode}

Check if user already exists in our database against the supplied protocol

Parameters
protocol_shortcode the identifier of the protocol for which the pages belong
id user id that is returned when user was created on our system.
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/user/{id}/check/{protocol_shortcode}
Example response
{ result: "john.smith@gmail.com" }

GET https://app.cartelux.com/api/v1.0/io/verify_page_permissions/{page_id}/{protocol_shortcode}

Check if we have permission for the requested page.

Parameters
protocol_shortcode the identifier of the protocol for which the industries belong
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/verify_page_permissions/{page_id}/{protocol_shortcode}

GET https://app.cartelux.com/api/v1.0/io/send_page_access_request/{user_id}/{page_id}/{protocol_shortcode}

Send request to give permission for the page.

Parameters
protocol_shortcode the identifier of the protocol for which the industries belong
Example request
curl -X GET -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/io/send_page_access_request/{user_id}/{page_id}/{protocol_shortcode}

POST https://app.cartelux.com/api/v1.0/io/user/authenticate/{protocol_shortcode}

This redirects the user to a login page for the requested protocol, so it's best to redirect the user to this by way of a form submission.

Parameters
protocol_shortcode the identifier of the protocol to authenticate against
access_token an access token which can be fetched via the /oauth/token action
id an identifier for the user within your system
identifier an identifier is a custom text string used to identify the user eg. name, franchise
Example request

    {access_token}" />
    
    
    Submit

GET https://app.cartelux.com/api/v1.0/video/templates

Lists all the templates available to your company

Example request
curl -H "Authorization: Bearer {access_token}" https://app.cartelux.com/api/v1.0/video/templates
Example response
[
    {
        "id": 10,
        "name": "small template",
        "shortcode": "small-template",
        "created": "2019-10-30 13:06:56",
        "edited": "2019-10-30 13:07:10",
        "deleted": null
    },
    {
        "id": 17,
        "name": "ShortForm",
        "shortcode": "shortform",
        "created": "2020-01-07 12:14:56",
        "edited": null,
        "deleted": null
    }
]