Contact
var client = new RestClient("https://api.messageflow.com/v2.1/contact?offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&group=SOME_INTEGER_VALUE&id=SOME_INTEGER_VALUE&externalId=SOME_STRING_VALUE&phoneNumber=SOME_STRING_VALUE&email=SOME_STRING_VALUE&inArchive=SOME_BOOL_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "REPLACE_KEY_VALUE");
request.AddHeader("application-key", "REPLACE_KEY_VALUE");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.messageflow.com/v2.1/contact?offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&group=SOME_INTEGER_VALUE&id=SOME_INTEGER_VALUE&externalId=SOME_STRING_VALUE&phoneNumber=SOME_STRING_VALUE&email=SOME_STRING_VALUE&inArchive=SOME_BOOL_VALUE"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "REPLACE_KEY_VALUE")
req.Header.Add("application-key", "REPLACE_KEY_VALUE")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.get("https://api.messageflow.com/v2.1/contact?offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&group=SOME_INTEGER_VALUE&id=SOME_INTEGER_VALUE&externalId=SOME_STRING_VALUE&phoneNumber=SOME_STRING_VALUE&email=SOME_STRING_VALUE&inArchive=SOME_BOOL_VALUE")
.header("authorization", "REPLACE_KEY_VALUE")
.header("application-key", "REPLACE_KEY_VALUE")
.asString();
var request = require("request");
var options = {
method: 'GET',
url: 'https://api.messageflow.com/v2.1/contact',
qs: {
offset: 'SOME_INTEGER_VALUE',
limit: 'SOME_INTEGER_VALUE',
group: 'SOME_INTEGER_VALUE',
id: 'SOME_INTEGER_VALUE',
externalId: 'SOME_STRING_VALUE',
phoneNumber: 'SOME_STRING_VALUE',
email: 'SOME_STRING_VALUE',
inArchive: 'SOME_BOOL_VALUE'
},
headers: {authorization: 'REPLACE_KEY_VALUE', 'application-key': 'REPLACE_KEY_VALUE'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.messageflow.com/v2.1/contact?offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&group=SOME_INTEGER_VALUE&id=SOME_INTEGER_VALUE&externalId=SOME_STRING_VALUE&phoneNumber=SOME_STRING_VALUE&email=SOME_STRING_VALUE&inArchive=SOME_BOOL_VALUE",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"application-key: REPLACE_KEY_VALUE",
"authorization: REPLACE_KEY_VALUE"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://api.messageflow.com/v2.1/contact"
querystring = {"offset":"SOME_INTEGER_VALUE","limit":"SOME_INTEGER_VALUE","group":"SOME_INTEGER_VALUE","id":"SOME_INTEGER_VALUE","externalId":"SOME_STRING_VALUE","phoneNumber":"SOME_STRING_VALUE","email":"SOME_STRING_VALUE","inArchive":"SOME_BOOL_VALUE"}
headers = {
'authorization': "REPLACE_KEY_VALUE",
'application-key': "REPLACE_KEY_VALUE"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.messageflow.com/v2.1/contact?offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&group=SOME_INTEGER_VALUE&id=SOME_INTEGER_VALUE&externalId=SOME_STRING_VALUE&phoneNumber=SOME_STRING_VALUE&email=SOME_STRING_VALUE&inArchive=SOME_BOOL_VALUE")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["authorization"] = 'REPLACE_KEY_VALUE'
request["application-key"] = 'REPLACE_KEY_VALUE'
response = http.request(request)
puts response.read_body
http GET 'https://api.messageflow.com/v2.1/contact?offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&group=SOME_INTEGER_VALUE&id=SOME_INTEGER_VALUE&externalId=SOME_STRING_VALUE&phoneNumber=SOME_STRING_VALUE&email=SOME_STRING_VALUE&inArchive=SOME_BOOL_VALUE' \
application-key:REPLACE_KEY_VALUE \
authorization:REPLACE_KEY_VALUE --header 'authorization: REPLACE_KEY_VALUE'
var client = new RestClient("https://api.messageflow.com/v2.1/contact");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "REPLACE_KEY_VALUE");
request.AddHeader("application-key", "REPLACE_KEY_VALUE");
request.AddParameter("application/json", "[{\"companyName\":\"Example company\",\"createdAt\":\"2019-02-01 20:12:12\",\"email\":\"test@test.pl\",\"externalId\":\"XXX-XXX-XXX\",\"firstName\":\"First name\",\"lastName\":\"Last name\",\"phoneNumber\":\"123123123\",\"externalData\":{\"test\":\"test\",\"createdAt\":\"1989-09-28\",\"isClient\":false},\"addToGroup\":[0]}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.messageflow.com/v2.1/contact"
payload := strings.NewReader("[{\"companyName\":\"Example company\",\"createdAt\":\"2019-02-01 20:12:12\",\"email\":\"test@test.pl\",\"externalId\":\"XXX-XXX-XXX\",\"firstName\":\"First name\",\"lastName\":\"Last name\",\"phoneNumber\":\"123123123\",\"externalData\":{\"test\":\"test\",\"createdAt\":\"1989-09-28\",\"isClient\":false},\"addToGroup\":[0]}]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("authorization", "REPLACE_KEY_VALUE")
req.Header.Add("application-key", "REPLACE_KEY_VALUE")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.post("https://api.messageflow.com/v2.1/contact")
.header("content-type", "application/json")
.header("authorization", "REPLACE_KEY_VALUE")
.header("application-key", "REPLACE_KEY_VALUE")
.body("[{\"companyName\":\"Example company\",\"createdAt\":\"2019-02-01 20:12:12\",\"email\":\"test@test.pl\",\"externalId\":\"XXX-XXX-XXX\",\"firstName\":\"First name\",\"lastName\":\"Last name\",\"phoneNumber\":\"123123123\",\"externalData\":{\"test\":\"test\",\"createdAt\":\"1989-09-28\",\"isClient\":false},\"addToGroup\":[0]}]")
.asString();
var request = require("request");
var options = {
method: 'POST',
url: 'https://api.messageflow.com/v2.1/contact',
headers: {
'content-type': 'application/json',
authorization: 'REPLACE_KEY_VALUE',
'application-key': 'REPLACE_KEY_VALUE'
},
body: [
{
companyName: 'Example company',
createdAt: '2019-02-01 20:12:12',
email: 'test@test.pl',
externalId: 'XXX-XXX-XXX',
firstName: 'First name',
lastName: 'Last name',
phoneNumber: '123123123',
externalData: {test: 'test', createdAt: '1989-09-28', isClient: false},
addToGroup: [0]
}
],
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.messageflow.com/v2.1/contact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "[{\"companyName\":\"Example company\",\"createdAt\":\"2019-02-01 20:12:12\",\"email\":\"test@test.pl\",\"externalId\":\"XXX-XXX-XXX\",\"firstName\":\"First name\",\"lastName\":\"Last name\",\"phoneNumber\":\"123123123\",\"externalData\":{\"test\":\"test\",\"createdAt\":\"1989-09-28\",\"isClient\":false},\"addToGroup\":[0]}]",
CURLOPT_HTTPHEADER => array(
"application-key: REPLACE_KEY_VALUE",
"authorization: REPLACE_KEY_VALUE",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://api.messageflow.com/v2.1/contact"
payload = "[{\"companyName\":\"Example company\",\"createdAt\":\"2019-02-01 20:12:12\",\"email\":\"test@test.pl\",\"externalId\":\"XXX-XXX-XXX\",\"firstName\":\"First name\",\"lastName\":\"Last name\",\"phoneNumber\":\"123123123\",\"externalData\":{\"test\":\"test\",\"createdAt\":\"1989-09-28\",\"isClient\":false},\"addToGroup\":[0]}]"
headers = {
'content-type': "application/json",
'authorization': "REPLACE_KEY_VALUE",
'application-key': "REPLACE_KEY_VALUE"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.messageflow.com/v2.1/contact")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'REPLACE_KEY_VALUE'
request["application-key"] = 'REPLACE_KEY_VALUE'
request.body = "[{\"companyName\":\"Example company\",\"createdAt\":\"2019-02-01 20:12:12\",\"email\":\"test@test.pl\",\"externalId\":\"XXX-XXX-XXX\",\"firstName\":\"First name\",\"lastName\":\"Last name\",\"phoneNumber\":\"123123123\",\"externalData\":{\"test\":\"test\",\"createdAt\":\"1989-09-28\",\"isClient\":false},\"addToGroup\":[0]}]"
response = http.request(request)
puts response.read_body
echo '[{"companyName":"Example company","createdAt":"2019-02-01 20:12:12","email":"test@test.pl","externalId":"XXX-XXX-XXX","firstName":"First name","lastName":"Last name","phoneNumber":"123123123","externalData":{"test":"test","createdAt":"1989-09-28","isClient":false},"addToGroup":[0]}]' | \
http POST https://api.messageflow.com/v2.1/contact \
application-key:REPLACE_KEY_VALUE \
authorization:REPLACE_KEY_VALUE \
content-type:application/jsondAt":"1989-09-28","isClient":false},"addToGroup":[0]}]'
var client = new RestClient("https://api.messageflow.com/v2.1/contact");
var request = new RestRequest(Method.PUT);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "REPLACE_KEY_VALUE");
request.AddHeader("application-key", "REPLACE_KEY_VALUE");
request.AddParameter("application/json", "[{\"externalId\":\"bfa0b1b1-e636-b8ab-aba4-78a913be0144\",\"data\":{\"companyName\":\"Example company\",\"email\":\"test@test.pl\",\"externalId\":\"XXX-XXX-XXX\",\"firstName\":\"First name\",\"lastName\":\"Last name\",\"phoneNumber\":\"123123123\",\"externalData\":{\"test\":\"test\",\"createdAt\":\"1989-09-28\",\"isClient\":false}}}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.messageflow.com/v2.1/contact"
payload := strings.NewReader("[{\"externalId\":\"bfa0b1b1-e636-b8ab-aba4-78a913be0144\",\"data\":{\"companyName\":\"Example company\",\"email\":\"test@test.pl\",\"externalId\":\"XXX-XXX-XXX\",\"firstName\":\"First name\",\"lastName\":\"Last name\",\"phoneNumber\":\"123123123\",\"externalData\":{\"test\":\"test\",\"createdAt\":\"1989-09-28\",\"isClient\":false}}}]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("authorization", "REPLACE_KEY_VALUE")
req.Header.Add("application-key", "REPLACE_KEY_VALUE")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.put("https://api.messageflow.com/v2.1/contact")
.header("content-type", "application/json")
.header("authorization", "REPLACE_KEY_VALUE")
.header("application-key", "REPLACE_KEY_VALUE")
.body("[{\"externalId\":\"bfa0b1b1-e636-b8ab-aba4-78a913be0144\",\"data\":{\"companyName\":\"Example company\",\"email\":\"test@test.pl\",\"externalId\":\"XXX-XXX-XXX\",\"firstName\":\"First name\",\"lastName\":\"Last name\",\"phoneNumber\":\"123123123\",\"externalData\":{\"test\":\"test\",\"createdAt\":\"1989-09-28\",\"isClient\":false}}}]")
.asString();
var request = require("request");
var options = {
method: 'PUT',
url: 'https://api.messageflow.com/v2.1/contact',
headers: {
'content-type': 'application/json',
authorization: 'REPLACE_KEY_VALUE',
'application-key': 'REPLACE_KEY_VALUE'
},
body: [
{
externalId: 'bfa0b1b1-e636-b8ab-aba4-78a913be0144',
data: {
companyName: 'Example company',
email: 'test@test.pl',
externalId: 'XXX-XXX-XXX',
firstName: 'First name',
lastName: 'Last name',
phoneNumber: '123123123',
externalData: {test: 'test', createdAt: '1989-09-28', isClient: false}
}
}
],
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
var request = require("request");
var options = {
method: 'PUT',
url: 'https://api.messageflow.com/v2.1/contact',
headers: {
'content-type': 'application/json',
authorization: 'REPLACE_KEY_VALUE',
'application-key': 'REPLACE_KEY_VALUE'
},
body: [
{
externalId: 'bfa0b1b1-e636-b8ab-aba4-78a913be0144',
data: {
companyName: 'Example company',
email: 'test@test.pl',
externalId: 'XXX-XXX-XXX',
firstName: 'First name',
lastName: 'Last name',
phoneNumber: '123123123',
externalData: {test: 'test', createdAt: '1989-09-28', isClient: false}
}
}
],
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
import requests
url = "https://api.messageflow.com/v2.1/contact"
payload = "[{\"externalId\":\"bfa0b1b1-e636-b8ab-aba4-78a913be0144\",\"data\":{\"companyName\":\"Example company\",\"email\":\"test@test.pl\",\"externalId\":\"XXX-XXX-XXX\",\"firstName\":\"First name\",\"lastName\":\"Last name\",\"phoneNumber\":\"123123123\",\"externalData\":{\"test\":\"test\",\"createdAt\":\"1989-09-28\",\"isClient\":false}}}]"
headers = {
'content-type': "application/json",
'authorization': "REPLACE_KEY_VALUE",
'application-key': "REPLACE_KEY_VALUE"
}
response = requests.request("PUT", url, data=payload, headers=headers)
print(response.text)
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.messageflow.com/v2.1/contact")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'REPLACE_KEY_VALUE'
request["application-key"] = 'REPLACE_KEY_VALUE'
request.body = "[{\"externalId\":\"bfa0b1b1-e636-b8ab-aba4-78a913be0144\",\"data\":{\"companyName\":\"Example company\",\"email\":\"test@test.pl\",\"externalId\":\"XXX-XXX-XXX\",\"firstName\":\"First name\",\"lastName\":\"Last name\",\"phoneNumber\":\"123123123\",\"externalData\":{\"test\":\"test\",\"createdAt\":\"1989-09-28\",\"isClient\":false}}}]"
response = http.request(request)
puts response.read_body
echo '[{"externalId":"bfa0b1b1-e636-b8ab-aba4-78a913be0144","data":{"companyName":"Example company","email":"test@test.pl","externalId":"XXX-XXX-XXX","firstName":"First name","lastName":"Last name","phoneNumber":"123123123","externalData":{"test":"test","createdAt":"1989-09-28","isClient":false}}}]' | \
http PUT https://api.messageflow.com/v2.1/contact \
application-key:REPLACE_KEY_VALUE \
authorization:REPLACE_KEY_VALUE \
content-type:application/json":"test","createdAt":"1989-09-28","isClient":false}}}]'
var client = new RestClient("https://api.messageflow.com/v2.1/contact");
var request = new RestRequest(Method.DELETE);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "REPLACE_KEY_VALUE");
request.AddHeader("application-key", "REPLACE_KEY_VALUE");
request.AddParameter("application/json", "{\"id\":[1]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.messageflow.com/v2.1/contact"
payload := strings.NewReader("{\"id\":[1]}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("authorization", "REPLACE_KEY_VALUE")
req.Header.Add("application-key", "REPLACE_KEY_VALUE")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.delete("https://api.messageflow.com/v2.1/contact")
.header("content-type", "application/json")
.header("authorization", "REPLACE_KEY_VALUE")
.header("application-key", "REPLACE_KEY_VALUE")
.body("{\"id\":[1]}")
.asString();
var request = require("request");
var options = {
method: 'DELETE',
url: 'https://api.messageflow.com/v2.1/contact',
headers: {
'content-type': 'application/json',
authorization: 'REPLACE_KEY_VALUE',
'application-key': 'REPLACE_KEY_VALUE'
},
body: {id: [1]},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.messageflow.com/v2.1/contact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => "{\"id\":[1]}",
CURLOPT_HTTPHEADER => array(
"application-key: REPLACE_KEY_VALUE",
"authorization: REPLACE_KEY_VALUE",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://api.messageflow.com/v2.1/contact"
payload = "{\"id\":[1]}"
headers = {
'content-type': "application/json",
'authorization': "REPLACE_KEY_VALUE",
'application-key': "REPLACE_KEY_VALUE"
}
response = requests.request("DELETE", url, data=payload, headers=headers)
print(response.text)
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.messageflow.com/v2.1/contact")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'REPLACE_KEY_VALUE'
request["application-key"] = 'REPLACE_KEY_VALUE'
request.body = "{\"id\":[1]}"
response = http.request(request)
puts response.read_body
echo '{"id":[1]}' | \
http DELETE https://api.messageflow.com/v2.1/contact \
application-key:REPLACE_KEY_VALUE \
authorization:REPLACE_KEY_VALUE \
content-type:application/jsoncontent-type: application/json' \
--data '{"id":[1]}'
Last updated