NAV
JSON

Public API Documentation

What will you be able to do with our Public API?

Thanks to our Public API and depending of the role of your credentials you will be able to do several thing such as:

Quick Start

First of all, an admin of your account have to ask AB Tasty for PublicAPI credentials.

Authentication

An example of POST request here:

{
  "client_id":"XXXXXX",
  "client_secret":"XXXXXX",
  "grant_type":"client_credentials"
}

And an example of answer:

{
  "access_token": "12345678QZSEDRFGHJK234567SDFGH234567SDF",
  "expires_in": 43200,
  "token_type": "bearer",
  "scope": "XXX"
}

To authenticate you will need to use this route:

POST https://api2.abtasty.com/oauth/v2/token

Arguments

Parameter Type Required Format Description
client_id string true Example: “2_xe68dghl0ghoo42vay79rytcv” The client ID
client_secret string true Example: “34g7fpjzq2gww08w84owgrghuowk4goog4kkwkk4s0c057f48kksc” The client secret
grant_type string true Value to use: “client_credentials” The grant type: client_credentials

Get my tests informations

With this role you will be able to:

Get all tests of the account

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/tests?filter[type][]=ab&filter[type][]=mastersegment&filter[active]=1

and the answer is:

{
  "page": 1,
  "limit": 10,
  "pages": 1,
  "total": 2,
  "_links": {
    "self": {
        "href": "/api/core/accounts/41902/tests?filter%5Btype%5D%5B0%5D=ab&filter%5Btype%5D%5B1%5D=mastersegment&filter%5Bactive%5D=1&_page=1&_max_per_page=10"
    },
    "first": {
        "href": "/api/core/accounts/41902/tests?filter%5Btype%5D%5B0%5D=ab&filter%5Btype%5D%5B1%5D=mastersegment&filter%5Bactive%5D=1&_page=1&_max_per_page=10"
    },
    "last": {
        "href": "/api/core/accounts/41902/tests?filter%5Btype%5D%5B0%5D=ab&filter%5Btype%5D%5B1%5D=mastersegment&filter%5Bactive%5D=1&_page=1&_max_per_page=10"
    }
  },
  "_embedded": {
    "items": [
        {
            "type": "mastersegment",
            "labels": [
                "silviya",
                "Gil"
            ],
            "start_datetime": 0,
            "stop_datetime": 0,
            "state": "play",
            "preprod": false,
            "tunnel_parent": 0,
            "test_visitor_count": 9,
            "id": 365111,
            "name": "Gil Test",
            "traffic": 100,
            "active": true,
            "url": "master",
            "ga": 0,
            "omniture": 0,
            "at_internet": 0,
            "report_token": "c2ff5d513d9f78c7087cf53263d6ba53",
            "last_pause_timestamp": 0,
            "last_play_timestamp": 1542811579,
            "script_verified": false,
            "global_code": "",
            "autodes_goal": "",
            "autodes_goal_last_visitors": 0,
            "start_stop_timezone": "Europe/Brussels",
            "data_collect_version": 3,
            "creation_date": "2018-11-21T15:43:18+0100",
            "useragent": "",
            "ht_access": "",
            "creator_id": 47121,
            "visitors_count": 0,
            "original_visitors_count": 0,
            "test_rank": 0,
            "history_calc_mode": "new",
            "targeting_event_mode": "fastest",
            "dynamic_alloc_goal_id": null,
            "source_code": null,
            "description": null,
            "dynamic_alloc_modulation": 50,
            "reference_variation_id": null,
            "audience_id": null,
            "_links": {
                "self": {
                    "href": "/api/core/accounts/41902/tests/365111"
                },
                "targetings": {
                    "href": "/api/core/accounts/41902/tests/365111/targetings"
                },
                "tool_links": {
                    "href": "/api/core/accounts/41902/tests/365111/toollinks"
                },
                "variations": {
                    "href": "/api/core/accounts/41902/tests/365111/variations"
                },
                "goals": {
                    "href": "/api/core/accounts/41902/tests/365111/goals"
                },
                "nested": {
                    "href": "/api/interface/accounts/41902/tests/365111/nested"
                }
            },
            "_embedded": {
                "account": {
                    "id": 41902
                },
                "folder": null,
            }
        },
        {
            "type": "ab",
            "labels": [
                "arthur.charbit"
            ],
            "start_datetime": 0,
            "stop_datetime": 0,
            "state": "play",
            "preprod": false,
            "tunnel_parent": 0,
            "test_visitor_count": 0,
            "id": 367659,
            "name": "test",
            "traffic": 50,
            "active": true,
            "url": "http://abtastylab.com/60511af14f5e48764b83d36ddb8ece5a/",
            "ga": 0,
            "omniture": 0,
            "at_internet": 0,
            "report_token": "0bb21bc01326175ec51e16c17e0e396f",
            "last_pause_timestamp": 0,
            "last_play_timestamp": 1545921356,
            "script_verified": false,
            "global_code": "",
            "autodes_goal": "",
            "autodes_goal_last_visitors": 0,
            "start_stop_timezone": "Europe/Brussels",
            "data_collect_version": 3,
            "creation_date": "2018-11-26T11:57:12+0100",
            "useragent": "",
            "ht_access": "",
            "creator_id": 43571,
            "visitors_count": 0,
            "original_visitors_count": 0,
            "test_rank": 0,
            "history_calc_mode": "new",
            "targeting_event_mode": "fastest",
            "dynamic_alloc_goal_id": null,
            "source_code": null,
            "description": null,
            "dynamic_alloc_modulation": 50,
            "reference_variation_id": null,
            "audience_id": "c82c4865-e2d0-49b9-b0b9-7c74c59a826f",
            "_links": {
                "self": {
                    "href": "/api/core/accounts/41902/tests/367659"
                },
                "targetings": {
                    "href": "/api/core/accounts/41902/tests/367659/targetings"
                },
                "tool_links": {
                    "href": "/api/core/accounts/41902/tests/367659/toollinks"
                },
                "variations": {
                    "href": "/api/core/accounts/41902/tests/367659/variations"
                },
                "goals": {
                    "href": "/api/core/accounts/41902/tests/367659/goals"
                },
                "nested": {
                    "href": "/api/interface/accounts/41902/tests/367659/nested"
                }
            },
            "_embedded": {
                "account": {
                    "id": 41902
                },
                "folder": null,
            }
        }
    ]
  }
}

To get all test of the account I need to use this route:

GET /api/core/accounts/{account_id}/tests

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account

Filters

Name Datatype Description Pattern Default
_page integer Page of the collection 10
_max_per_page integer Limit of items per page 10
filter[name] string Search by name of the test
filter[name_or_url] string Search by name and url of the test
filter[search] string Search by name/url/id of the test
filter[parent][] integer Search by parent id (0 for no parent)
filter[type][] Search by test type (ab/mastersegment/predictive/segmentation/
tunnel/mvt/multipage/
multivariate/subsegment/mobileapp/heatmap)
filter[folder][] integer Search by folder id (0 for no folder)
filter[active] 0 => pause ; 1 => play (0/1)
filter[is_preprod] If is set only preprod test will be returned
filter[is_schedule] 0 -> test not schedule ; 1 -> test schedule (0/1)
filter[exclude_tag][] string exclude specific tag of the collection
filter[tag][] string only test with specific tag of the collection
filter[_order][id] Order collecion by id (ASC/DESC)
filter[_order][name] Order collection by name (ASC/DESC)

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Get information of one test

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/tests/381296

and the answer is:

{
    "type": "ab",
    "labels": [
        "arthur.charbit"
    ],
    "start_datetime": 0,
    "stop_datetime": 0,
    "state": "pause",
    "preprod": false,
    "tunnel_parent": 0,
    "test_visitor_count": 0,
    "id": 381296,
    "name": "Public API Test",
    "traffic": 50,
    "active": false,
    "url": "http://abtastylab.com/60511af14f5e48764b83d36ddb8ece5a/",
    "ga": 0,
    "omniture": 0,
    "at_internet": 0,
    "report_token": "3b5975f6df992ae275129514bde82a9f",
    "last_pause_timestamp": 0,
    "last_play_timestamp": null,
    "script_verified": false,
    "global_code": "",
    "autodes_goal": "",
    "autodes_goal_last_visitors": 0,
    "start_stop_timezone": "Europe/Brussels",
    "data_collect_version": 3,
    "creation_date": "2018-12-28T16:18:29+0100",
    "useragent": "",
    "ht_access": "",
    "creator_id": 43571,
    "visitors_count": 0,
    "original_visitors_count": 0,
    "test_rank": 0,
    "history_calc_mode": "new",
    "targeting_event_mode": "fastest",
    "dynamic_alloc_goal_id": null,
    "source_code": null,
    "description": null,
    "dynamic_alloc_modulation": 50,
    "reference_variation_id": null,
    "audience_id": "987a7647-e378-487a-bbb1-6353a4501db1",
    "_links": {
        "self": {
            "href": "/api/core/accounts/41902/tests/381296"
        },
        "targetings": {
            "href": "/api/core/accounts/41902/tests/381296/targetings"
        },
        "tool_links": {
            "href": "/api/core/accounts/41902/tests/381296/toollinks"
        },
        "variations": {
            "href": "/api/core/accounts/41902/tests/381296/variations"
        },
        "goals": {
            "href": "/api/core/accounts/41902/tests/381296/goals"
        },
        "nested": {
            "href": "/api/interface/accounts/41902/tests/381296/nested"
        }
    },
    "_embedded": {
        "account": {
            "id": 41902
        },
        "folder": null,
    }
}

To get test informations from one specific test of my account I need to use this route:

GET /api/core/accounts/{account_id}/tests/{test_id}

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test

Filters

Name Datatype Description Pattern Default
_max_per_page integer Limit of items per page 10
_page integer Page of the collection 10

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Get targetings of one test

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/tests/381301/targetings

and the answer is:

[
    {
        "type": "url",
        "sector": "",
        "data": [
            {
                "id": "url-983605",
                "format": "https://abtastylab.com/60511af14f5e48764b83d36ddb8ece5a/",
                "condition": "simplematch",
                "include": true
            }
        ]
    },
    {
        "type": "ip",
        "sector": "",
        "data": [
            {
                "id": "ip-1106739",
                "condition": "88.190.117.61",
                "format": "",
                "include": false
            },
            {
                "id": "ip-1106740",
                "condition": "88.190.117.65|88.190.117.69",
                "format": "",
                "include": false
            }
        ]
    }
]

To get targetings from one specific test of my account I need to use this route:

GET /api/core/accounts/{account_id}/tests/{test_id}/targetings

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Get one specific targeting

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/tests/381301/targetings/ip-1106739

and the answer is:

{
    "id": "ip-1106739",
    "format": "",
    "condition": "88.190.117.61",
    "include": false
}

To get one specific targeting of one specific test of my account I need to use this route:

GET /api/core/accounts/{account_id}/tests/{test_id}/targetings/{targeting_id}

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test
targeting_id \d+ Integer ID of the targeting

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Get the variations of a test

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/tests/381301/variations

and the answer is:

[
    {
        "id": 0,
        "name": "Original",
        "type": "onthefly",
        "traffic": 50
    },
    {
        "id": 491035,
        "name": "Variation 1",
        "traffic": 50,
        "type": "onthefly",
        "description": null
    }
]

To get every variations of one specific test of my account I need to use this route:

GET /api/core/accounts/{account_id}/tests/{test_id}/variations

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Get one specific variation

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/tests/381301/variations/491035

and the answer is:

{
    "id": 491035,
    "name": "Variation 1",
    "description": null,
    "traffic": 50,
    "type": "onthefly",
    "_links": {
        "self": {
            "href": "/api/core/accounts/41902/tests/381301/variations/491035"
        }
    }
}

To get one specific variation of one specific test of my account I need to use this route:

GET /api/core/accounts/{account_id}/tests/{test_id}/variations/{variation_id}

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Get modifications of a variation

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/tests/381301/variations/491035/modifications

and the answer is:

{
    "page": 1,
    "limit": 10,
    "pages": 1,
    "total": 1,
    "_links": {
        "self": {
            "href": "/api/core/accounts/41902/tests/381301/variations/491035/modifications?_page=1&_max_per_page=10"
        },
        "first": {
            "href": "/api/core/accounts/41902/tests/381301/variations/491035/modifications?_page=1&_max_per_page=10"
        },
        "last": {
            "href": "/api/core/accounts/41902/tests/381301/variations/491035/modifications?_page=1&_max_per_page=10"
        }
    },
    "_embedded": {
        "items": [
            {
                "use_modification_engine": true,
                "id": 2064015,
                "selector": "#myCarousel .active IMG",
                "type": "hideCSS",
                "value": "#myCarousel .active IMG {display:none!important;}",
                "name": "",
                "recursive": "no",
                "value_engine": "",
                "_links": {
                    "self": {
                        "href": "/api/core/accounts/41902/tests/381301/variations/491035/modifications/2064015"
                    }
                }
            }
        ]
    }
}

To get modifications applied on a variation of one specific test of my account I need to use this route:

GET /api/core/accounts/{account_id}/tests/{test_id}/variations/{variation_id}/modifications

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test
variation_id \d+ integer ID of the variation

Filters

Name Datatype Description Pattern Default
_max_per_page integer Limit of items per page 10
_page integer Page of the collection 10
filter[Operation] string Search by operation of the modification

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Get a specific modification of a variation

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/tests/381301/variations/491035/modifications/2064015

and the answer is:

{
    "use_modification_engine": true,
    "id": 2064015,
    "selector": "#myCarousel .active IMG",
    "type": "hideCSS",
    "value": "#myCarousel .active IMG {display:none!important;}",
    "name": "",
    "recursive": "no",
    "value_engine": "",
    "_links": {
        "self": {
            "href": "/api/core/accounts/41902/tests/381301/variations/491035/modifications/2064015"
        }
    }
}

To get a specific modification applied on a variation of one specific test of my account I need to use this route:

GET /api/core/accounts/{account_id}/tests/{test_id}/variations/{variation_id}/modifications/{modification_id}

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test
variation_id \d+ integer ID of the variation
modification_id \d+ Integer ID of the modification

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/tests/381301/toollinks

and the answer is:

{
    "page": 1,
    "limit": 10,
    "pages": 1,
    "total": 2,
    "_links": {
        "self": {
            "href": "/api/core/accounts/41902/tests/381301/toollinks?_page=1&_max_per_page=10"
        },
        "first": {
            "href": "/api/core/accounts/41902/tests/381301/toollinks?_page=1&_max_per_page=10"
        },
        "last": {
            "href": "/api/core/accounts/41902/tests/381301/toollinks?_page=1&_max_per_page=10"
        }
    },
    "_embedded": {
        "items": [
            {
                "id": 114112,
                "name": "Universal Analytics",
                "value": "12",
                "from_account": 1,
                "custom_tracker": null,
                "_links": {
                    "self": {
                        "href": "/api/core/accounts/41902/tests/381301/toollinks/114112"
                    }
                }
            },
            {
                "id": 114115,
                "name": "ATInternetSmartTag",
                "value": "10",
                "from_account": 0,
                "custom_tracker": null,
                "_links": {
                    "self": {
                        "href": "/api/core/accounts/41902/tests/381301/toollinks/114115"
                    }
                }
            }
        ]
    }
}

To get every web analytics tool linked to a test of my account I need to use this route:

GET /api/core/accounts/{account_id}/tests/{test_id}/toollinks

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test

Filters

Name Datatype Description Default
_page integer Page of the collection 1
_max_per_page integer Limit of items per page 10

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/tests/381301/toollinks/114115

and the answer is:

{
    "id": 114115,
    "name": "ATInternetSmartTag",
    "value": "10",
    "from_account": 0,
    "custom_tracker": null,
    "_links": {
        "self": {
            "href": "/api/core/accounts/41902/tests/381301/toollinks/114115"
        }
    }
}

To get one specific web analytics tool linked to a test of my account I need to use this route:

GET /api/core/accounts/{account_id}/tests/{test_id}/toollinks/{toollinks_id}

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test
toollinks_id \d+ Integer ID of the tool linked

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Get events set up in a test

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/tests/381301/global_modifications

and the answer is:

{
    "page": 1,
    "limit": 10,
    "pages": 1,
    "total": 1,
    "_links": {
        "self": {
            "href": "/api/core/accounts/41902/tests/381301/global_modifications?_page=1&_max_per_page=10"
        },
        "first": {
            "href": "/api/core/accounts/41902/tests/381301/global_modifications?_page=1&_max_per_page=10"
        },
        "last": {
            "href": "/api/core/accounts/41902/tests/381301/global_modifications?_page=1&_max_per_page=10"
        }
    },
    "_embedded": {
        "items": [
            {
                "id": 162007,
                "type": "actionTracking",
                "config": "AT",
                "value": "{\"name\":\"AT \",\"event\":\"mousedown\",\"data\":\"\",\"elementSelector\":\"#main .text-center:nth-child(4) H1\"}",
                "_links": {
                    "self": {
                        "href": "/api/core/accounts/41902/tests/381301/global_modifications/162007"
                    }
                }
            }
        ]
    }
}

To get events set up in a test of my account I need to use this route:

GET /api/core/accounts/{account_id}/tests/{test_id}/global_modifications

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test

Filters

Name Datatype Description Pattern Default
_page integer Page of the collection 1
_max_per_page integer Limit of items per page 10
filter[type] string Type of the global modification
(plugin or actionTracking)
A valid type
filter[_order][id] Order collection by id (ASC/DESC)

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Get account’s tests statistics

An example of GET request here:

https://api.abtasty.com/api/core/accounts/41902/general_statistics

and the answer is:

{
    "campaign_states": {
        "ab": {
            "running": 1,
            "paused": 381
        },
        "multivariate": {
            "running": 0,
            "paused": 16
        },
        "multipage": {
            "running": 0,
            "paused": 68
        },
        "predictive": {
            "running": 0,
            "paused": 22
        },
        "byapi": {
            "running": 0,
            "paused": 0
        },
        "personalization": {
            "running": 0,
            "paused": 97
        }
    },
    "count_collaborators": 35,
    "count_collaborators_connections": 5,
    "started_experiments": [
        {
            "month_year": "1-2018",
            "count_visitors": "2467",
            "count_tests": "1"
        }
    ],
    "created_experiments": [
        {
            "month_year": "1-2019",
            "count_visitors": "38",
            "count_tests": "13",
            "avg_visitors": "3"
        },
        {
            "month_year": "12-2018",
            "count_visitors": "50",
            "count_tests": "11",
            "avg_visitors": "5"
        }
    ],
    "played_experiments": [
        {
            "month_year": "12-2018",
            "count_visitors": "50",
            "count_tests": "1"
        }
    ],
}

To get the global statistics of my tests on my account I need to use this route:

GET /api/core/accounts/{account_id}/general_statistics

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Manage my tests

With this role you will be able to:

Play a test

An example of PATCH request here:

https://api.abtasty.com/api/interface/accounts/41902/tests/381301/play

And the body you need to insert

{
  "mode":"prod"
}

if everything was going well, it will return a success answer with a 204.

To play a test of my account I need to use this route:

PATCH /api/interface/accounts/{account_id}/tests/{test_id}/play

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test

Parameters

Name Required Description Format
mode false Should it be in prod or preprod (prod if no parameters passed in the JSON) preprod|prod

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Pause a test

An example of PATCH request here:

https://api.abtasty.com/api/interface/accounts/41902/tests/381301/pause

if everything was going well, it will return a success answer with a 204.

To pause a test of my account I need to use this route:

PATCH /api/interface/accounts/{account_id}/tests/{test_id}/pause

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Schedule a test

An example of PATCH request here:

https://api.abtasty.com/api/interface/accounts/41902/tests/381301/schedule

And the body you need to insert:

{
	"start_at":"2018-12-30T19:05:00",
	"stop_at":"2018-12-30T19:13:00",
	"timezone":"Europe/Paris"
}

if everything was going well, it will return a success answer with a 204.

To schedule a test of my account I need to use this route:

PATCH /api/interface/accounts/{account_id}/tests/{test_id}/schedule

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
test_id \d+ Integer ID of the test

Parameters

Name Required Description Format
start_at false when do you want to start the test YYYY-MM-DDTHH:MM:SS
stop_at false when do you want to start the test YYYY-MM-DDTHH:MM:SS
timezone false which timezone do you want to use

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Manage AB Tasty’s users of my account

With this role you will be able to:

Get all AB Tasty’s users of my account

An example of GET request here:

https://api2.abtasty.com/api/core/accounts/41902/membership?_max_per_page=1

And the answer you will received (note that I limited the result to 1):

{
    "page": 1,
    "limit": 1,
    "pages": 34,
    "total": 34,
    "_links": {
        "self": {
            "href": "/api/core/accounts/41902/membership?_page=1&_max_per_page=1"
        },
        "first": {
            "href": "/api/core/accounts/41902/membership?_page=1&_max_per_page=1"
        },
        "last": {
            "href": "/api/core/accounts/41902/membership?_page=34&_max_per_page=1"
        },
        "next": {
            "href": "/api/core/accounts/41902/membership?_page=2&_max_per_page=1"
        }
    },
    "_embedded": {
        "items": [
            {
                "id": 80397,
                "role": "admin",
                "_links": {
                    "self": {
                        "href": "/api/core/accounts/41902/membership/80397"
                    },
                    "account": {
                        "href": "/api/core/accounts/41902"
                    }
                },
                "_embedded": {
                    "user": {
                        "id": 2021,
                        "email": "remi@abtasty.com",
                        "lastname": "Aubert",
                        "firstname": "Remi",
                        "creation_date": "2012-07-24T18:10:33+0200",
                        "connection_count": 49708,
                        "last_login_time": "2019-02-14T09:50:39+0100",
                        "mfa_phone_number": "688142865",
                        "mfa_phone_indicative": "33",
                        "mfa_enabled": true,
                        "_links": {
                            "self": {
                                "href": "/api/core/users/2021"
                            }
                        },
                        "_embedded": {
                            "has_multiple_accounts": true
                        }
                    }
                }
            }
        ]
    }
}

if you correctly have access to the account, it will return a 200.

To get a list of every user of my account I need to use this route:

GET /api/core/accounts/{account_id}/membership

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account

Filters

Name Datatype Description Pattern Default
_max_per_page Integer Limit of items per page 10
_page integer Page of the collection 1

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Get specific information about an AB Tasty user

An example of GET request here:

https://api2.abtasty.com/api/core/accounts/41902/membership/132419

And the answer you will received:

{
    "id": 132419,
    "role": "admin",
    "_links": {
        "self": {
            "href": "/api/core/accounts/41902/membership/132419"
        },
        "account": {
            "href": "/api/core/accounts/41902"
        }
    },
    "_embedded": {
        "user": {
            "id": 43571,
            "email": "arthur.charbit@abtasty.com",
            "lastname": "Charbit",
            "firstname": "Arthur",
            "creation_date": "2016-10-10T11:43:06+0200",
            "connection_count": 1161,
            "last_login_time": "2019-02-20T10:13:55+0100",
            "mfa_enabled": true,
            "_links": {
                "self": {
                    "href": "/api/core/users/43571"
                }
            },
            "_embedded": {
                "has_multiple_accounts": true
            }
        }
    }
}

To get information about a specific user of my AB Tasty account I need to use this route:

GET /api/core/accounts/{account_id}/membership/{membership_id}

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
membership_id \d+ Integer ID of the user

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Give access to an AB Tasty user

An example of POST request here:

https://api2.abtasty.com/api/core/accounts/41902/membership

And the body you need to insert:

{
  "email":"test@gmail.com",
  "role":"user"
}

if you correctly have access to the account, it will return a 200.

To give access to a user:

POST /api/core/accounts/{account_id}/membership

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account

Parameters

Name Required Description Format
email true Email of the new user {email address}
role true Role of the user [admin|user|creator|viewer]

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Change the role of an AB Tasty user

An example of PATCH request here:

https://api2.abtasty.com/api/core/accounts/41902/membership/132419

And the body you need to insert:

{
  "role":"user"
}

if you correctly have access to the account, it will return a 204 no content.

To change role to a user which already have access to the account:

PATCH /api/core/accounts/{account_id}/membership/{membership_id}

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
membership_id \d+ Integer ID of the user

Parameters

Name Required Description Format
email true Email of the new user {email address}
role true Role of the user [admin|user|creator|viewer]

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Revoke access to a user

An example of DELETE request here:

https://api2.abtasty.com/api/core/accounts/41902/membership/132419

The request will return a 204 No Content if successful

To revoke access to an user on my account I need to use this route:

DELETE /api/core/accounts/{account_id}/membership/{membership_id}

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account
membership_id \d+ Integer ID of the user

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Update the AB Tasty Script

With this role you will be able to:

Update the AB Tasty Script

An example of PATCH request here:

https://api2.abtasty.com/api/interface/accounts/41902/update_script

The request will return a 204 No Content if successful

To update the AB Tasty Script of my account I need to use this route:

PATCH /api/interface/accounts/{account_id}/update_script

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Clear the AB Tasty Script

An example of PATCH request here:

https://api2.abtasty.com/api/interface/accounts/41902/clear_script

The request will return a 204 No Content if successful

To clear the AB Tasty script of my account I need to use this route:

PATCH /api/interface/accounts/{account_id}/clear_script

Requirements

Name Requirements Type Description
account_id \d+ integer ID of the account

Headers

Name Required Description
Content-Type true Format of the request
Authorization true User token (example: Bearer {token}
Accept-Language false Language use for the response (user setting can override this)

Status Code

Status code Description
[201] Returned when resource is create
[400] Returned when one or more parameters are invalid
[401] Returned when authentication is required
[403] Returned when you have not the necessary permissions for the resource
[404] Returned when resource could not be found