get_coupon_groups_m Sample Call and Response
This example shows an administrative client retrieving the full list of coupon groups defined for client number 400218, based on the get_coupon_groups_m method defined in methods_m_r73.yml.
This example shows the coupon-group list view: each group's identifying and descriptive fields only. It does not show the coupons assigned to any of these groups, which is the scope of the related get_coupon_group_details_m method instead.
Sample call
{
"rest_call": "get_coupon_groups_m",
"output_format": "json",
"client_no": 400218,
"auth_key": "7f3a9c1d2e4b5f6a8c9d0e1f2a3b4c5d"
}
The call takes only client_no and auth_key. This method accepts no filtering arguments; it always returns every coupon group the client has defined.
Sample response
{
"error_code": 0,
"error_msg": "OK",
"coupon_groups": [
{
"group_no": 71042,
"client_defined_id": "SEASONAL-PROMOS",
"group_name": "Seasonal Promotions",
"description": "Coupons grouped for recurring seasonal campaigns",
"precedence": "10"
},
{
"group_no": 71055,
"client_defined_id": "WIN-BACK-OFFERS",
"group_name": "Win-Back Offers",
"description": "Coupons targeted at lapsed accounts",
"precedence": "20"
},
{
"group_no": 71099,
"client_defined_id": "PARTNER-REFERRAL",
"group_name": "Partner Referral Program",
"description": "Coupons issued through partner referral campaigns",
"precedence": "30"
}
]
}
An error_code of zero with an error_msg of “OK” indicates the request succeeded. This response shows three representative coupon groups; a real response includes one entry for every coupon group the client has defined, not only these three. precedence is a string field in this method's yml definition (unlike the related get_coupon_details_m method, where the coupon's own precedence field is an integer), so the values are shown as quoted strings such as "10" rather than as numbers. None of this method's response fields are omitted; group_no, client_defined_id, group_name, description, and precedence are all shown for each group, and this method does not return the coupons assigned to each group, which is available only from get_coupon_group_details_m.