Update REPP doc

This commit is contained in:
Martin Lensment 2015-03-31 10:40:22 +03:00
parent bb93f8b609
commit d5a117dfc5
3 changed files with 194 additions and 65 deletions

View file

@ -5,7 +5,7 @@ Returns contacts of the current registrar.
#### Request #### Request
``` ```
GET /repp/v1/contacts?page=1 HTTP/1.1 GET /repp/v1/contacts?limit=1&details=true HTTP/1.1
Accept: application/json Accept: application/json
Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ== Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ==
Content-Length: 0 Content-Length: 0
@ -16,55 +16,118 @@ Content-Type: application/json
``` ```
HTTP/1.1 200 HTTP/1.1 200
Cache-Control: max-age=0, private, must-revalidate Cache-Control: max-age=0, private, must-revalidate
Content-Length: 867 Content-Length: 483
Content-Type: application/json Content-Type: application/json
X-XSS-Protection: 1; mode=block
{ {
"contacts": [ "contacts": [
{ {
"registrar_id": 1,
"id": 1, "id": 1,
"code": "sh16377490", "code": "sh470279120",
"reg_no": null, "reg_no": null,
"phone": "+372.12345678", "phone": "+372.12345678",
"email": "juliet@oreilly.org", "email": "bettye.feil@ratkegoldner.net",
"fax": null, "fax": null,
"created_at": "2015-03-18T09:03:02.001Z", "created_at": "2015-03-31T07:39:10.854Z",
"updated_at": "2015-03-18T09:03:02.001Z", "updated_at": "2015-03-31T07:39:10.854Z",
"ident": "37605030299", "ident": "37605030299",
"ident_type": "priv", "ident_type": "priv",
"created_by_id": null, "created_by_id": null,
"updated_by_id": null, "updated_by_id": null,
"auth_info": "password", "auth_info": "password",
"name": "Adrianna Ferry0", "name": "Leopoldo Waelchi0",
"org_name": null, "org_name": null,
"creator_str": null,
"updator_str": null,
"ident_country_code": "EE"
},
{
"registrar_id": 1, "registrar_id": 1,
"id": 2, "creator_str": "autotest",
"code": "sh63156547", "updator_str": "autotest",
"reg_no": null,
"phone": "+372.12345678",
"email": "juliet@oreilly.org",
"fax": null,
"created_at": "2015-03-18T09:03:02.052Z",
"updated_at": "2015-03-18T09:03:02.052Z",
"ident": "37605030299",
"ident_type": "priv",
"created_by_id": null,
"updated_by_id": null,
"auth_info": "password",
"name": "Miss Stuart Ritchie1",
"org_name": null,
"creator_str": null,
"updator_str": null,
"ident_country_code": "EE" "ident_country_code": "EE"
} }
], ],
"total_pages": 1 "total_number_of_records": 2
}
```
## GET /repp/v1/contacts
Returns contact names with offset.
### Example
#### Request
```
GET /repp/v1/contacts?offset=1 HTTP/1.1
Accept: application/json
Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ==
Content-Length: 0
Content-Type: application/json
```
#### Response
```
HTTP/1.1 200
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 56
Content-Type: application/json
{
"contacts": [
"sh226475261"
],
"total_number_of_records": 2
}
```
## GET /repp/v1/contacts
Returns contact names of the current registrar.
### Example
#### Request
```
GET /repp/v1/contacts HTTP/1.1
Accept: application/json
Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ==
Content-Length: 0
Content-Type: application/json
```
#### Response
```
HTTP/1.1 200
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 70
Content-Type: application/json
{
"contacts": [
"sh470279120",
"sh226475261"
],
"total_number_of_records": 2
}
```
## GET /repp/v1/contacts
Returns an error with invalid parameters in contact index.
### Example
#### Request
```
GET /repp/v1/contacts?limit=0 HTTP/1.1
Accept: application/json
Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ==
Content-Length: 0
Content-Type: application/json
```
#### Response
```
HTTP/1.1 400
Cache-Control: no-cache
Content-Length: 45
Content-Type: application/json
{
"error": "limit does not have a valid value"
} }
``` ```

View file

@ -5,7 +5,7 @@ Returns domains of the current registrar.
#### Request #### Request
``` ```
GET /repp/v1/domains?page=1 HTTP/1.1 GET /repp/v1/domains?limit=1&details=true HTTP/1.1
Accept: application/json Accept: application/json
Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ== Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ==
Content-Length: 0 Content-Length: 0
@ -16,53 +16,117 @@ Content-Type: application/json
``` ```
HTTP/1.1 200 HTTP/1.1 200
Cache-Control: max-age=0, private, must-revalidate Cache-Control: max-age=0, private, must-revalidate
Content-Length: 1859 Content-Length: 909
Content-Type: application/json Content-Type: application/json
X-XSS-Protection: 1; mode=block
{ {
"domains": [ "domains": [
{ {
"registrar_id": 1,
"id": 1, "id": 1,
"name": "domain0.ee", "name": "domain0.ee",
"registered_at": "2015-03-18T09:03:02.686Z", "registrar_id": 1,
"registered_at": "2015-03-31T07:39:11.598Z",
"status": null, "status": null,
"valid_from": "2015-03-18T00:00:00.000Z", "valid_from": "2015-03-31T00:00:00.000Z",
"valid_to": "2016-03-18T00:00:00.000Z", "valid_to": "2016-03-31T00:00:00.000Z",
"owner_contact_id": 1, "owner_contact_id": 1,
"auth_info": "085f8c4cf5af0c14615a2da64f6a84c2", "auth_info": "fc7828fbc275ff16b86a31def3e7a60d",
"created_at": "2015-03-18T09:03:02.681Z", "created_at": "2015-03-31T07:39:11.595Z",
"updated_at": "2015-03-18T09:03:02.680Z", "updated_at": "2015-03-31T07:39:11.591Z",
"name_dirty": "domain0.ee", "name_dirty": "domain0.ee",
"name_puny": "domain0.ee", "name_puny": "domain0.ee",
"period": 1, "period": 1,
"period_unit": "y", "period_unit": "y",
"creator_str": null, "creator_str": null,
"updator_str": null, "updator_str": null,
"whois_body": " This Whois Server contains information on\n Estonian Top Level Domain ee TLD\n\n domain: domain0.ee\n registrar: registrar1\n status:\n registered:\n changed: 2015-03-18 09:03:02\n expire:\n outzone:\n delete:\n\n contact\n name:\n e-mail:\n registrar:\n created:\n\n contact:\n\n nsset:\n nserver:\n\n registrar:\n org:\n url:\n phone:\n address:\n created:\n changed:\n" "whois_body": " This Whois Server contains information on\n Estonian Top Level Domain ee TLD\n\n domain: domain0.ee\n registrar: registrar1\n status:\n registered: \n changed: 2015-03-31 07:39:11\n expire:\n outzone:\n delete:\n\n \n\n nsset:\n nserver:\n\n registrar: registrar1\n phone: \n address: Street 111, Town, County, Postal\n created: 2015-03-31 07:39:11\n changed: 2015-03-31 07:39:11\n"
},
{
"registrar_id": 1,
"id": 2,
"name": "domain1.ee",
"registered_at": "2015-03-18T09:03:02.856Z",
"status": null,
"valid_from": "2015-03-18T00:00:00.000Z",
"valid_to": "2016-03-18T00:00:00.000Z",
"owner_contact_id": 3,
"auth_info": "79fdd1a0174be7e141c2930aff278b43",
"created_at": "2015-03-18T09:03:02.854Z",
"updated_at": "2015-03-18T09:03:02.854Z",
"name_dirty": "domain1.ee",
"name_puny": "domain1.ee",
"period": 1,
"period_unit": "y",
"creator_str": null,
"updator_str": null,
"whois_body": " This Whois Server contains information on\n Estonian Top Level Domain ee TLD\n\n domain: domain1.ee\n registrar: registrar1\n status:\n registered:\n changed: 2015-03-18 09:03:02\n expire:\n outzone:\n delete:\n\n contact\n name:\n e-mail:\n registrar:\n created:\n\n contact:\n\n nsset:\n nserver:\n\n registrar:\n org:\n url:\n phone:\n address:\n created:\n changed:\n"
} }
], ],
"total_pages": 1 "total_number_of_records": 2
}
```
## GET /repp/v1/domains
Returns domain names with offset.
### Example
#### Request
```
GET /repp/v1/domains?offset=1 HTTP/1.1
Accept: application/json
Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ==
Content-Length: 0
Content-Type: application/json
```
#### Response
```
HTTP/1.1 200
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 54
Content-Type: application/json
{
"domains": [
"domain1.ee"
],
"total_number_of_records": 2
}
```
## GET /repp/v1/domains
Returns domain names of the current registrar.
### Example
#### Request
```
GET /repp/v1/domains HTTP/1.1
Accept: application/json
Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ==
Content-Length: 0
Content-Type: application/json
```
#### Response
```
HTTP/1.1 200
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 67
Content-Type: application/json
{
"domains": [
"domain0.ee",
"domain1.ee"
],
"total_number_of_records": 2
}
```
## GET /repp/v1/domains
Returns an error with invalid parameters in domain index.
### Example
#### Request
```
GET /repp/v1/domains?limit=0 HTTP/1.1
Accept: application/json
Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ==
Content-Length: 0
Content-Type: application/json
```
#### Response
```
HTTP/1.1 400
Cache-Control: no-cache
Content-Length: 45
Content-Type: application/json
{
"error": "limit does not have a valid value"
} }
``` ```

View file

@ -89,5 +89,7 @@ RSpec.configure do |config|
c.syntax = [:should, :expect] c.syntax = [:should, :expect]
end end
Autodoc.configuration.path = "doc/repp/v1" Autodoc.configuration.path = 'doc/repp/v1'
Autodoc.configuration.suppressed_request_header = ['Host']
Autodoc.configuration.suppressed_response_header = ['ETag', 'X-Request-Id', 'X-Runtime']
end end