# Scheduled Voice Setting

There are many cases where you might need to change the Scheduled Time of voice call which you had scheduled earlier. To do so, use this API.

## Reschedule (Change) the Schedule Date of Voice Call

<mark style="color:orange;">`PUT`</mark> `<base_url>/bulk-voice/reschedule`

#### Request Body

| Name          | Type    | Description                                                                   |
| ------------- | ------- | ----------------------------------------------------------------------------- |
| voice\_id     | integer | Unique ID which was received in **response** while sending the voice call.    |
| new\_send\_at | integer | Epoch Time (time in milliseconds) as like Voice Call **`send_at`** parameter. |
| timezone      | string  | Timezone. Refer the Timezone Table for more information.                      |

{% tabs %}
{% tab title="200 " %}

```javascript
{    status: true,    message: "Voice call rescheduled successfully."}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{    "status":false,    "message":"Information about why the request is rejected (in string format)"}
```

{% endtab %}

{% tab title="401 " %}

```javascript
{    "status":false,    "message":"Auth-Error root cause will be stated here."}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{    "status":false,    "message":"Forbidded Resource Access."}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{    "status":false,    "message":"Something Went Wrong"}
```

{% endtab %}
{% endtabs %}

### Example: Rescheduling/Changing the scheduled time of voice

A **`HTTP PUT`** request must have body in below format.

#### Request:

{% tabs %}
{% tab title="Rescheduled-Voice-Request.json" %}

```javascript
{    
"voice_id": XXX, // The Unique ID you got in response of Send-Voice call request.    
"new_send_at": 1569266700,    
"timezone": "Asia/Kolkata(GMT +05:30)" // timezone
}
```

{% endtab %}
{% endtabs %}

#### Response:

After the request is successfully received at our server, response will be like below with ***`Status Code: 200`***

{% tabs %}
{% tab title="Rescheduled-Voice-Response.json" %}

```javascript
{    status: true,    message: "Voice call rescheduled successfully."}
```

{% endtab %}
{% endtabs %}

## Cancel Scheduled Voice Call

If you have scheduled a voice call for future date/time, but because of any reason you may want to cancel the call, before it is actually sent to the recipient. To do so, this API comes handy. &#x20;

## Cancel Scheduled Voice Call

<mark style="color:red;">`DELETE`</mark> `<base_url>/bulk-voice/cancelScheduled/{voice_id}`

#### Path Parameters

| Name      | Type   | Description                                                              |
| --------- | ------ | ------------------------------------------------------------------------ |
| voice\_id | number | **Unique ID** which was received in the **response** of Send Voice Call. |

{% tabs %}
{% tab title="200 " %}

```javascript
{    status: true,     message: "Voice call cancelled successfully."}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{    "status":false,    "message":"Information about why the request is rejected (in string format)"}
```

{% endtab %}

{% tab title="401 " %}

```javascript
{    "status":false,    "message":"Auth-Error root cause will be stated here."}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{    "status":false,    "message":"Forbidded Resource Access."}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{    "status":false,    "message":"Something Went Wrong"}
```

{% endtab %}
{% endtabs %}

### Example: Cancel/Delete The scheduled Voice Call

A **`HTTP DELTE`** request must have URL in below format.

#### Request URL:

{% tabs %}
{% tab title="" %}

```java
https://<base_url>/bulk-voice/cancelScheduled/207 
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
here, ***`207`*** is the Unique ID of Send Voice Call Request.
{% endhint %}

#### Response:

After the request is successfully received at our server, response will be like below with ***`Status Code: 200`***

{% tabs %}
{% tab title="Cancel-Scheduled-Voice-Response.json" %}

```javascript
{    status: true,    message: "Voice call cancelled successfully."}
```

{% endtab %}
{% endtabs %}
