Create a Contact defined by contact.
POST
https://api.usetrust.app/v1/contacts
Body Parameters
- bodyContactInput
- workspaceIdstringExampleDescription
- firstnamestringExampleDescription
- lastnamestringExampleDescription
- emailstringExampleDescription
- imageUrlstringExampleDescription
- phonestringExampleDescription
Responses
201
- Contact
- idstring<uuid>
- createdstring<date-time>
- firstNamestring
- lastNamestring
- phonestring
- emailstring
- imageUrlstring
400
- string
500
- string
curl
curl --request POST \
--url https://api.usetrust.app/v1/contacts \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.usetrust.app/v1/contacts", 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("https://api.usetrust.app/v1/contacts")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.usetrust.app/v1/contacts"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
csharp
var options = new RestClientOptions("https://api.usetrust.app")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/contacts", Method.Post);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);201
// Returns created contact.
{
"id": "",
"created": "",
"firstName": "",
"lastName": "",
"phone": "",
"email": "",
"imageUrl": ""
}400
// Bad Request
""500
// Internal Server Error
""