mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 04:37:30 +02:00
Docs: REPP contact management
This commit is contained in:
parent
d2d7bfb386
commit
7fd31b7004
1 changed files with 138 additions and 0 deletions
|
@ -88,3 +88,141 @@ Content-Type: application/json
|
||||||
"total_number_of_records": 2
|
"total_number_of_records": 2
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## POST /repp/v1/contacts
|
||||||
|
Creates new contact
|
||||||
|
|
||||||
|
|
||||||
|
#### Request
|
||||||
|
```
|
||||||
|
POST /repp/v1/contacts HTTP/1.1
|
||||||
|
Authorization: Basic dGVzdDp0ZXN0MTIz
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"contact": {
|
||||||
|
"name": "John Doe",
|
||||||
|
"email": "john@doe.com",
|
||||||
|
"phone": "+371.1234567",
|
||||||
|
"ident": {
|
||||||
|
"ident": "12345678901",
|
||||||
|
"ident_type": "priv",
|
||||||
|
"ident_country_code": "EE"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Response
|
||||||
|
```
|
||||||
|
HTTP/1.1 200
|
||||||
|
Cache-Control: max-age=0, private, must-revalidate
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"code": 1000,
|
||||||
|
"message": "Command completed successfully",
|
||||||
|
"data": {
|
||||||
|
"contact": {
|
||||||
|
"id": "ATSAA:20DCDCA1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Failed response
|
||||||
|
```
|
||||||
|
HTTP/1.1 400
|
||||||
|
Cache-Control: max-age=0, private, must-revalidate
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"code": 2005,
|
||||||
|
"message": "Ident code does not conform to national identification number format of Estonia",
|
||||||
|
"data": {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## PUT /repp/v1/contacts/**contact id**
|
||||||
|
Updates existing contact
|
||||||
|
|
||||||
|
|
||||||
|
#### Request
|
||||||
|
```
|
||||||
|
PUT /repp/v1/contacts/ATSAA:9CD5F321 HTTP/1.1
|
||||||
|
Authorization: Basic dGVzdDp0ZXN0MTIz
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"contact": {
|
||||||
|
"phone": "+372.123123123"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Response
|
||||||
|
```
|
||||||
|
HTTP/1.1 200
|
||||||
|
Cache-Control: max-age=0, private, must-revalidate
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"code": 1000,
|
||||||
|
"message": "Command completed successfully",
|
||||||
|
"data": {
|
||||||
|
"contact": {
|
||||||
|
"id": "ATSAA:20DCDCA1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Failed response
|
||||||
|
```
|
||||||
|
HTTP/1.1 400
|
||||||
|
Cache-Control: max-age=0, private, must-revalidate
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"code": 2005,
|
||||||
|
"message": "Phone nr is invalid [phone]",
|
||||||
|
"data": {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## DELETE /repp/v1/contacts/**contact id**
|
||||||
|
Deletes existing contact
|
||||||
|
|
||||||
|
|
||||||
|
#### Request
|
||||||
|
```
|
||||||
|
DELETE /repp/v1/contacts/ATSAA:9CD5F321 HTTP/1.1
|
||||||
|
Authorization: Basic dGVzdDp0ZXN0MTIz
|
||||||
|
Content-Type: application/json
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Response
|
||||||
|
```
|
||||||
|
HTTP/1.1 200
|
||||||
|
Cache-Control: max-age=0, private, must-revalidate
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"code": 1000,
|
||||||
|
"message": "Command completed successfully",
|
||||||
|
"data": {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Failed response
|
||||||
|
```
|
||||||
|
HTTP/1.1 400
|
||||||
|
Cache-Control: max-age=0, private, must-revalidate
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"code": 2305,
|
||||||
|
"message": "Object association prohibits operation [domains]",
|
||||||
|
"data": {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue