Table of Contents

API : Product campaign Take over

Introduction

This request lets a reseller take over a master campaign it is named on, to offer it to its own customers at its own customer price. The result is a copy on the reseller's own product with fromCampaign pointing at the master campaign. See copies for how a copy follows its master.

Request

URL https://api.telecomx.dk/product/PRODUCT_ID/campaign/takeOver
Method POST
Param PRODUCT_ID Id of the reseller's rateplan product
Access level RESELLER with write access to the reseller, RESELLER_ADMIN or ADMIN.
Body
campaign Id Id of the master campaign to take over.
price Number What the reseller's customers pay per month during the campaign, 0-999999.
name String [optional] The reseller's own name for the campaign, 1-64 characters. Default: the master campaign's name. Leave it out rather than sending an empty string, which is refused.
message String [optional] Free text for the UI, up to 1024 characters.

Any other field is refused (422), because the copy takes it from the master campaign.

Example

POST https://api.telecomx.dk/product/665ef4b42ed3cfb02005fdc9/campaign/takeOver
{
  "campaign": "6aba6a8be5b8b45688b9faed",
  "price": 20,
  "name": "Sundbynets efterÄrstilbud"
}

Response

The new copy - the same fields as Create returns, plus:

JSON object
fromCampaign Id Id of the master campaign the copy was taken over from.

If the master campaign was stopped while the request was being handled, the copy is stopped straight away and returned with stoppedAt set.

Errors

Several validation errors at once are returned together as 422 multiple, with each error listed inside.

Error code Message Description
422 <property> Invalid input for the named property - the request body, query or URL parameter failed validation
403 access_denied Insufficient access level
403 takeOver The master campaign does not include this reseller
404 not_found Product not found
404 takeOver The campaign was not found on the master product this rateplan inherits from
409 type Campaigns can only be created on MVNO and SIP rateplan products
409 inheritFromReseller Campaigns cannot be created on a customer product - create it on the reseller product it inherits from
409 takeOver Only a reseller product inheriting from a master product can take over a master campaign
409 takeOver The master campaign has been stopped
409 takeOver The master campaign has stopped enrolling
409 alreadyTakenOver The master campaign has already been taken over on this product
409 overlap The enrolment window overlaps another campaign on this product - two campaigns open at the same time on one product cannot both apply
409 concurrentChange The campaign was changed by someone else while this request was being handled - reload and try again
500 internal_error <Unspecified>