curl -X POST \
https://useapi.useinbox.com/notify/v1/send \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"from": {
"name": "Example",
"email": "[email protected]"
},
"to": [
{"email":"[email protected]"}
],
"subject": "Welcome",
"htmlContent": "Welcome to INBOXNotify"
}'
require 'uri'
require 'net/http'
url = URI("https://useapi.useinbox.com/notify/v1/send")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\"from\": {\"name\": \"Example\",\"email\": \"[email protected]\"},\"to\": [{\"email\":\"[email protected]\"}],\"subject\": \"Welcome\",\"htmlContent\": \"Welcome to INBOXNotify\"}\n"
response = http.request(request)
puts response.read_body
import requests
url = "https://useapi.useinbox.com/notify/v1/send"
payload = "{\"from\": {\"name\": \"Example\",\"email\": \"[email protected]\"},\"to\": [{\"email\":\"[email protected]\"}],\"subject\": \"Welcome\",\"htmlContent\": \"Welcome to INBOXNotify\"}\n"
headers = {
'Content-Type': "application/json",
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
setUrl('https://useapi.useinbox.com/notify/v1/send');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Content-Type' => 'application/json'
));
$request->setBody('{"from": {"name": "Example","email": "[email protected]"},"to": [{"email":"[email protected]"}],"subject": "Welcome","htmlContent": "Welcome to INBOXNotify"}
');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"from\": {\"name\": \"Example\",\"email\": \"[email protected]\"},\"to\": [{\"email\":\"[email protected]\"}],\"subject\": \"Welcome\",\"htmlContent\": \"Welcome to INBOXNotify\"}\n");
Request request = new Request.Builder()
.url("https://useapi.useinbox.com/notify/v1/send")
.post(body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Collapse
var client = new RestClient("https://useapi.useinbox.com/notify/v1/send");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\"from\": {\"name\": \"Example\",\"email\": \"[email protected]\"},\"to\": [{\"email\":\"[email protected]\"}],\"subject\": \"Welcome\",\"htmlContent\": \"Welcome to INBOXNotify\"}\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request)