Browse the help center

Replace a stale location

Swaps a stale location rule for a rule naming a place the geo database knows, with the same include or exclude and the same entity, and removes the stale rule; both changes are written to the action log.

Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/targeting/stale-locations/replace.do

Swaps a stale location rule for a rule naming a place the geo database knows, with the same include or exclude and the same entity, and removes the stale rule; both changes are written to the action log. Region and city are optional and checked like location targeting create. When the entity already has that rule, only the stale one is removed and 'alreadyPresent' is true. Country rules cannot be replaced; remove them instead. With targetId alone the answer is {removedId, targetId, value, alreadyPresent}. With targetIds (targetId may be given beside it) every listed rule is replaced on its own and the answer is {value, replaced:[{removedId, targetId, value, alreadyPresent}], skipped:[{targetId, reason, message}]}: a rule no longer stale or not the user's (NOT_STALE), one the role may not change (FORBIDDEN), or one whose swap failed and was rolled back (FAILED) is skipped without holding back the others. All the rules of one request must name the same stale place with the same include or exclude, as the list answers them in 'value' and 'rule'; otherwise nothing is changed.

Form Params

countryCode string required

ISO 3166-1 alpha-2 country code of the new place

US

targetId integer

Id of the stale location rule; required unless targetIds is given

8012

targetIds array<integer>

Ids of several stale location rules naming the same stale place with the same include or exclude, replaced in one request

8012

regionName string

Region of the new place, as GET /rest-api/targeting/country/region/values.do lists it

Nevada

cityName string

City of the new place, as GET /rest-api/targeting/country/region/city/values.do lists it

Las Vegas

Responses

200

targetId alone: {success, removedId, targetId, value, alreadyPresent}; targetIds: {success, value, replaced:[{removedId, targetId, value, alreadyPresent}], skipped:[{targetId, reason, message}]}

400

Unknown country code, region or city; a country rule; no rule named; rules naming different stale places or rules; or a new place that is the stale place itself

401

Authentication error

403

targetId alone: the role may not change this rule

404

targetId alone: not a stale rule the user may manage

503

The geo service did not answer

Please disable Adblock
Are you using adblock? Disable it and reload the page to proceed to the destination page.

A registration has already been submitted from this page. Please try again in 10 minutes.