设置代理(第三步)
# Set up proxy
**Brief description**:
- Proxy must be set for all interface calls. The proxy fails and the request returns a failure
- Therefore, developers need to maintain an effective S5 agent. If S5 fails, they can notify the administrator and replace it in time.
- Need to support S5 proxy
- Newly registered devices need to set up a long-term agent
- The long-term agent reports the heartbeat and invokes the interface
**Request URL**:
- {APIURL}/dy/device/set_proxy
- Access-Token
**Request mode**
- POST
**Request header Headers**
- Content-Type:multipart/form-data
**Parameter**:
|Parameter name | required | type | description
|-|-|-|-|
|proxy|||
- IP Agent service provider: [Interest carrying agency](https://www.xiequ.cn/index.html?a0a5af08) , Developers need to manage the validity of the proxy IP on the client side. If it fails, they need to switch to another proxy IP;
**Return data**:
|Parameter name | type | description|
|-|-|-|
|code|int|0success, -1 failure 1 prompt message|
|msg|string|feedback information|
|data|json| deviceInfo information|
**Request parameter example**
```
{
"device_id": "123232323",
"proxy_ip": "xx.xxx.xx.xx:3829",
"proxy_password": "xxx",
"proxy_username": "yyy"
}
```
```
{
"code": 0,
"data": {
"ip": "",
"proxies": {
"http": "socks5://xxxxx:xxx@xx:xx",
"https": "socks5://xxxx:xx@xxxx:xx"
},
"version_name": "19.4.0",
"version_code": 190400,
"manifest_version_code": 190401,
"update_version_code": 19409900,
"gen_time": "2022-02-12 15:20:41",
"_gen_time": xx,
"start_time": 1652338541.017984,
"start_time_ts": 1652338541,
"start_time_tk": 1652338541017,
"apk_first_install_time": xxxx,
"first_install_time": xxx,
"verify_ticket": "",
"data_user_ts
},
"msg": "success"
}
```
**Error return example**
```{
"msg": "Call failed",
"code": -1,
"data": null
}
```