URI | /v1/accounts/{username}/computers |
URI Parameters |
|
Methods | GET, POST |
GET /v1/accounts/{username}/computers
Gets an account's computers
Scope | computers_read |
Query Selector Parameters |
|
Query Pagination Parameters |
|
Query Sorting Parameters |
|
Request Body Parameters |
|
Response Attributes |
|
Example JSON
Request:
GET /v1/accounts/barracuda/computers HTTP/1.1
Host: api.intronis.com
Authorization: OAuth vF9dft4qmT
Accept: application/json
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"page": 2,
"page_size": 10,
"count": 12,
"links": [
{
"rel": "first",
"href": "https://api.intronis.com/v1/accounts/barracuda/computers?page=1"
},
{
"rel": "prev",
"href": "https://api.intronis.com/v1/accounts/barracuda/computers?page=1"
}
],
"list": [
{
"computer_id": "0010",
"name": "Mail Server",
"link": {
"rel": "self",
"href": "https://api.intronis.com/v1/accounts/barracuda/computers/0010"
}
},
{
"computer_id": "0011",
"name": "Personal Computer",
"link": {
"rel": "self",
"href": "https://api.intronis.com/v1/accounts/barracuda/computers/0011"
}
}
]
}
Example XML
Request:
GET /v1/accounts/barracuda/computers HTTP/1.1
Host: api.intronis.com
Authorization: OAuth vF9dft4qmT
Accept: application/xml
Response:
HTTP/1.1 200 OK
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<list page="2" page_size="10" count="12">
<link rel="first" href="https://api.intronis.com/v1/accounts/barracuda/computers?page=1"/>
<link rel="prev" href="https://api.intronis.com/v1/accounts/barracuda/computers?page=1"/>
<computer>
<computer_id>0010</computer_id>
<name>Mail Server</name>
<link rel="self" href="https://api.intronis.com/v1/accounts/barracuda/computers/0010"/>
</computer>
<computer>
<computer_id>0011</computer_id>
<name>Personal Computer</name>
<link rel="self" href="https://api.intronis.com/v1/accounts/barracuda/computers/0011"/>
</computer>
</list>
POST /v1/accounts/{username}/computers
Adds a new computer to an account.
Scope | computers_write |
Request Body Parameters |
|
Response Attributes |
|
Example JSON
Request:
POST /v1/accounts/barracuda/computers HTTP/1.1
Host: api.intronis.com
Authorization: OAuth vF9dft4qmT
Content-Type: application/json
{
"name": "Mail Server",
"password": "ps8wEzeT",
"email": "jsmith@barracuda.com",
"phone": "617-948-5300"
}
Response:
HTTP/1.1 201 Created
Location: https://api.intronis.com/v1/accounts/barracuda/computers/0001
Example XML
Request:
POST /v1/accounts/barracuda/computers HTTP/1.1
Host: api.intronis.com
Authorization: OAuth vF9dft4qmT
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<computer>
<name>Mail Server</name>
<password>ps8wEzeT</password>
<email>jsmith@barracuda.com</email>
<phone>617-948-5300</phone>
</computer>
Response:
HTTP/1.1 201 Created
Location: https://api.intronis.com/v1/accounts/barracuda/computers/0001