$client = new \GuzzleHttp\Client();
$response = $client->post('https://app.mailcamp.io/api/v1/smtp', [
'headers' => [
'Authorization' => 'Bearer {api_token}',
'Accept' => 'application/json',
],
'json' => [
'from' => ['email' => '[email protected]'],
'to' => [['email' => '[email protected]']],
'subject' => 'Welcome to Mailcamp',
'html' => '<h1>Hello from Mailcamp</h1>',
],
]);
package main
import (
"bytes"
"net/http"
)
func main() {
payload := []byte(`{
"from":{"email":"[email protected]"},
"to":[{"email":"[email protected]"}],
"subject":"Welcome to Mailcamp",
"html":"<h1>Hello from Mailcamp</h1>"
}`)
req, _ := http.NewRequest("POST", "https://app.mailcamp.io/api/v1/smtp", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer {api_token}")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")
http.DefaultClient.Do(req)
}
import requests
response = requests.post(
"https://app.mailcamp.io/api/v1/smtp",
headers={
"Authorization": "Bearer {api_token}",
"Content-Type": "application/json",
"Accept": "application/json",
},
json={
"from": {"email": "[email protected]"},
"to": [{"email": "[email protected]"}],
"subject": "Welcome to Mailcamp",
"html": "<h1>Hello from Mailcamp</h1>",
},
)
use reqwest::Client;
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let response = client
.post("https://app.mailcamp.io/api/v1/smtp")
.bearer_auth("{api_token}")
.header("Accept", "application/json")
.json(&serde_json::json!({
"from": {"email": "[email protected]"},
"to": [{"email": "[email protected]"}],
"subject": "Welcome to Mailcamp",
"html": "<h1>Hello from Mailcamp</h1>"
}))
.send()
.await?;
println!("{}", response.status());
Ok(())
}
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://app.mailcamp.io/api/v1/smtp"))
.header("Authorization", "Bearer {api_token}")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("""
{
\"from\": {\"email\": \"[email protected]\"},
\"to\": [{\"email\": \"[email protected]\"}],
\"subject\": \"Welcome to Mailcamp\",
\"html\": \"<h1>Hello from Mailcamp</h1>\"
}
"""))
.build();
HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
await fetch('https://app.mailcamp.io/api/v1/smtp', {
method: 'POST',
headers: {
'Authorization': 'Bearer {api_token}',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
from: { email: '[email protected]' },
to: [{ email: '[email protected]' }],
subject: 'Welcome to Mailcamp',
html: '<h1>Hello from Mailcamp</h1>'
})
});
curl --request POST 'https://app.mailcamp.io/api/v1/smtp' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"from": {"email": "[email protected]"},
"to": [{"email": "[email protected]"}],
"subject": "Welcome to Mailcamp",
"html": "<h1>Hello from Mailcamp</h1>"
}'
$client = new \GuzzleHttp\Client();
$response = $client->post('https://app.mailcamp.io/api/email/verify', [
'headers' => [
'Authorization' => 'Bearer {api_token}',
'Accept' => 'application/json',
],
'json' => [
'email' => '[email protected]',
],
]);
package main
import (
"bytes"
"net/http"
)
func main() {
payload := []byte(`{"email":"[email protected]"}`)
req, _ := http.NewRequest("POST", "https://app.mailcamp.io/api/email/verify", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer {api_token}")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")
http.DefaultClient.Do(req)
}
import requests
response = requests.post(
"https://app.mailcamp.io/api/email/verify",
headers={
"Authorization": "Bearer {api_token}",
"Content-Type": "application/json",
"Accept": "application/json",
},
json={"email": "[email protected]"},
)
use reqwest::Client;
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let response = client
.post("https://app.mailcamp.io/api/email/verify")
.bearer_auth("{api_token}")
.header("Accept", "application/json")
.json(&serde_json::json!({
"email": "[email protected]"
}))
.send()
.await?;
println!("{}", response.status());
Ok(())
}
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://app.mailcamp.io/api/email/verify"))
.header("Authorization", "Bearer {api_token}")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("""
{
\"email\": \"[email protected]\"
}
"""))
.build();
HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
await fetch('https://app.mailcamp.io/api/email/verify', {
method: 'POST',
headers: {
'Authorization': 'Bearer {api_token}',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
email: '[email protected]'
})
});
curl --request POST 'https://app.mailcamp.io/api/email/verify' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"email": "[email protected]"
}'