# Enable Shared Bandwidth - AllocateShareBandwidth

## Overview

Enable Shared Bandwidth






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `AllocateShareBandwidth`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.genesissai.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [List of Regions and Availability Zones](/docs/api/summary/regionlist) |**Yes**|
| **ProjectId** | string | Project ID. If not filled in, the default project will be used. Sub-accounts must be filled in. |No|
| **Name** | string | Shared Bandwidth Name |**Yes**|
| **ChargeType** | string | Payment method: Year Yearly, Month Monthly, Dynamic Hourly; |**Yes**|
| **ShareBandwidth** | int | Shared Bandwidth Value |**Yes**|
| **Quantity** | int | Purchasing Duration |No|
| **IPVersion** | string | Shared bandwidth type, IPv4 or IPv6, defaults to IPv4 if not passed. |No|
| **OperatorName** | string | Shared Bandwidth Line: BGP: BGP line; International: International line; Native IP: Native; Premium Native IP: Resident; BGPPro: Premium BGP line (Premium BGP is only supported in Hong Kong). |No|
| **Tag** | string | Business group name, default is "Default"  |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **ShareBandwidthId** | string | Shared Bandwidth Resource Id |No|




## Example

### Request Example
    
```
https://api.genesissai.com/?Action=AllocateShareBandwidth
&Region=cn-bj2
&ShareBandwidth=20
&ChargeType=Month
&Name=sharebwname
&BwType=XnbjjTdZ
&OperatorName=TUhLWpBx
&Tag=odFOhzhe
```

### Response Example
    
```json
{
  "Action": "AllocateShareBandwidthResponse",
  "Request_uuid": "94053674-0160-40f2-8981-XXXXXXX",
  "RetCode": 0,
  "ShareBandwidthId": "mdfMzyBm"
}
```





