Swap Subscriber’s Resource

The SwapSubscriberResource API in OCS.io is designed to streamline the process of swapping a subscriber’s resource with a new one.

API Overview

Fields Required for Swapping Subscriber Resource

The following table lists and describes the fields required to swap a subscriber resource through the SwapSubscriberResource API:

Field Description

subscriber

ID (Ref ID / External ID) of the Subscriber.

resourceType

Type of the Resource which will be used for guiding to Subscriber.

swapResource

Value of the Resource which will be swapped.

resource

New value of the Resource which will be used for guiding to Subscriber.

Detailed API documentation and endpoint specifics are available here.

Request Validations

The following validations are performed when swapping a subscriber’s resource:

  • Subscriber must be provided in the request, it must be already created in the system and must not be in Deactivated State.

  • Swap Resource must be provided in the request, it must exists on Subscriber.

  • Resource must be provided in the request, it must be unique and must not be already assigned to another Subscriber in other than Deactivated State.

  • If Resource is already assigned to another Subscriber in Deactivated State, that assignment will be ignored.

  • Resource Type must be provided in the request and it must be configured in the system.

  • Subscriber must not have assigned any Resource of the Resource Type. If there exists Resource for that Resource Type, Swap Subscriber’s Resource must be used instead.

Swap Subscriber Resource Example

Use the following request’s body to swap a subscriber resource:

{
  "requestId": "{{$guid}}",
  "transactionId": "{{$guid}}",
  "subscriber": {
    "externalId": "subscriber_external_id"
  },
  "resourceType": "ipV4",
  "swapResource": "10.0.0.1",
  "resource": "10.0.0.2"
}

The outcome of the API call is as follows:

  • The resource with the value 10.0.0.1 of type ipV4 is swapped with a new resource with the value 10.0.0.2 for the subscriber identified by external ID subscriber_external_id.