Skip to content

Commit

Permalink
Update REPP doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mlensment committed Mar 31, 2015
1 parent bb93f8b commit d5a117d
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 65 deletions.
127 changes: 95 additions & 32 deletions doc/repp/v1/contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Returns contacts of the current registrar.

#### Request
```
GET /repp/v1/contacts?page=1 HTTP/1.1
GET /repp/v1/contacts?limit=1&details=true HTTP/1.1
Accept: application/json
Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ==
Content-Length: 0
Expand All @@ -16,55 +16,118 @@ Content-Type: application/json
```
HTTP/1.1 200
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 867
Content-Length: 483
Content-Type: application/json
X-XSS-Protection: 1; mode=block
{
"contacts": [
{
"registrar_id": 1,
"id": 1,
"code": "sh16377490",
"code": "sh470279120",
"reg_no": null,
"phone": "+372.12345678",
"email": "juliet@oreilly.org",
"email": "bettye.feil@ratkegoldner.net",
"fax": null,
"created_at": "2015-03-18T09:03:02.001Z",
"updated_at": "2015-03-18T09:03:02.001Z",
"created_at": "2015-03-31T07:39:10.854Z",
"updated_at": "2015-03-31T07:39:10.854Z",
"ident": "37605030299",
"ident_type": "priv",
"created_by_id": null,
"updated_by_id": null,
"auth_info": "password",
"name": "Adrianna Ferry0",
"name": "Leopoldo Waelchi0",
"org_name": null,
"creator_str": null,
"updator_str": null,
"ident_country_code": "EE"
},
{
"registrar_id": 1,
"id": 2,
"code": "sh63156547",
"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,
"creator_str": "autotest",
"updator_str": "autotest",
"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"
}
```
128 changes: 96 additions & 32 deletions doc/repp/v1/domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Returns domains of the current registrar.

#### Request
```
GET /repp/v1/domains?page=1 HTTP/1.1
GET /repp/v1/domains?limit=1&details=true HTTP/1.1
Accept: application/json
Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ==
Content-Length: 0
Expand All @@ -16,53 +16,117 @@ Content-Type: application/json
```
HTTP/1.1 200
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 1859
Content-Length: 909
Content-Type: application/json
X-XSS-Protection: 1; mode=block
{
"domains": [
{
"registrar_id": 1,
"id": 1,
"name": "domain0.ee",
"registered_at": "2015-03-18T09:03:02.686Z",
"registrar_id": 1,
"registered_at": "2015-03-31T07:39:11.598Z",
"status": null,
"valid_from": "2015-03-18T00:00:00.000Z",
"valid_to": "2016-03-18T00:00:00.000Z",
"valid_from": "2015-03-31T00:00:00.000Z",
"valid_to": "2016-03-31T00:00:00.000Z",
"owner_contact_id": 1,
"auth_info": "085f8c4cf5af0c14615a2da64f6a84c2",
"created_at": "2015-03-18T09:03:02.681Z",
"updated_at": "2015-03-18T09:03:02.680Z",
"auth_info": "fc7828fbc275ff16b86a31def3e7a60d",
"created_at": "2015-03-31T07:39:11.595Z",
"updated_at": "2015-03-31T07:39:11.591Z",
"name_dirty": "domain0.ee",
"name_puny": "domain0.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: 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"
},
{
"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"
"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"
}
],
"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"
}
```
4 changes: 3 additions & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,7 @@
c.syntax = [:should, :expect]
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

0 comments on commit d5a117d

Please sign in to comment.