Create new Vet for a Clinic
1 min
POST
/api/v1/vets
Body Parameters
- bodyobjectrequired
- first_namestringrequiredExample
- last_namestringrequiredExample
- emailstringrequiredExample
- phonestringExampleDescription
- clinic_idintegerrequiredExample
- role_idintegerrequiredExample
- servicesinteger[]requiredDescription
- passwordstringrequiredExample
- titlestringExampleDescription
- license_numberstringExampleDescription
- language_idintegerExample
- video_linkstringExampleDescription
- has_user_chatbooleanExampleDescription
Responses
201
- object
- dataVet
- idintegerExample
- first_nameintegerExample
- last_namestringExample
- full_namestringExample
- name_with_titlestringExample
- emailstringExample
- phonestringExample
- avatarstringExample
- stampstringExample
- license_numberstringExample
- job_titlestringExample
- deleted_atstring<date-time>
- activebooleanExample
- video_linkstringExample
- public_appointment_linkstringExample
- typestring<veterinarian | technician | groomer>
- two_factor_enabledbooleanExample
- has_chat_userbooleanExampleDescription
curl
curl --request POST \
--url /api/v1/vets \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data-raw '{
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"clinic_id": 1,
"role_id": 1,
"services": [],
"password": "123456"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"clinic_id": 1,
"role_id": 1,
"services": [],
"password": "123456"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("/api/v1/vets", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("/api/v1/vets")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"clinic_id": 1,
"role_id": 1,
"services": [],
"password": "123456"
})
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "/api/v1/vets"
payload = json.dumps({
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"clinic_id": 1,
"role_id": 1,
"services": [],
"password": "123456"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
201
// successful operation
{
"data": {
"id": 1,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"name_with_title": "Dr. John Doe",
"email": "[email protected]",
"phone": "123456789",
"avatar": "https://vet.digitail.io/images/profilepic.jpg",
"stamp": "https://vet.digitail.io/images/signature.jpg",
"license_number": "123456789",
"job_title": "Dr.",
"deleted_at": "",
"active": true,
"video_link": "https://digitail.com/video",
"public_appointment_link": "https://digitail.com/clinics/clinic-slug/vet-slug",
"type": "",
"two_factor_enabled": true,
"has_chat_user": true
}
}