How to Disable Call Forwarding

Warning: Beta software This API is in beta stage and may be subject to change. Therefore, we do not recommend using this in production.

Interested in this feature? Please reach out to mobility-services-developer@cisco.com

Prerequisites

  1. An OAuth 2.0 client
  2. A client access token

Required Scope

  • callforwarding.disable

Code Dependencies

<dependency>
  <groupId>com.wgtwo.api.v0.grpc</groupId>
  <artifactId>callforward</artifactId>
  <version>0.3.0</version>
</dependency>

Code


#!/usr/bin/env bash
grpcurl \
  -d '{
        "subscriber": { "e164": "+4672xxxxxxx"}
      }' \
  sandbox.api.shamrock.wgtwo.com:443 \
  wgtwo.callforward.v0.CallForwardingService/Disable

package com.example.callforwarding

import com.wgtwo.api.v0.callforward.CallForwardingProto
import com.wgtwo.api.v0.callforward.CallForwardingServiceGrpc
import com.wgtwo.api.v0.common.PhoneNumberProto
import io.grpc.ManagedChannelBuilder

fun main() {
    val channel = ManagedChannelBuilder.forAddress("sandbox.api.shamrock.wgtwo.com", 443).build()
    val stub = CallForwardingServiceGrpc.newBlockingStub(channel)

    val message = with(CallForwardingProto.DisableCallForwardingRequest.newBuilder()) {
        this.subscriber = with(PhoneNumberProto.PhoneNumber.newBuilder()) {
            this.e164 = "+4672xxxxxxx"
            build()
        }
        build()
    }

    val result = stub.disable(message)
    if (result.status == CallForwardingProto.CallForwardingResponse.Status.ACCEPTED) {
        println("Successfully disabled call forwarding")
        println(result)
    } else {
        println(
            """
            Failure to disable call forwarding:
            status=${result.status}
            description=${result.errorMessage}"
            """.trimIndent(),
        )
    }
}

Example Results

{
  "status": "ACCEPTED"
}
Successfully disabled call forwarding
status: ACCEPTED

Read More