Donor
Send Donor Inquiry
POST
/v2/organization/:corporation/inquiry/donor
Headers
Url
Body
Response
{
data: {
id: <INQUIRY_ID>
},
success: true
}
Code
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`
data.append('firstname', 'Testfirstname');
data.append('lastname', 'Teslastname');
data.append('email', 'testing@test.com');
data.append('phone', '(555) 555-5555');
data.append('website', 'https://mywebsite.com');
data.append('organization', 'NYT');
data.append('location_city', 'New York City');
data.append('location_state', 'NY');
data.append('location_country', 'US');
data.append('username', '<EXPERT USERNAME>');
data.append('donor_type', 'not_for_profit');
data.append('donor_focus', 'other');
data.append('message', 'This is a test message to the expert...');
fetch('https://public-api.expertfile.com/v2/organization/:corporation/inquiry/donor', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': `Bearer ${accessToken}`
},
body: data
})
.then(response => response.json())
.then(json => {
const { success, data, error } = json
if (success) {
const { id } = data
console.log('New inquiry id', id)
}
})
.catch(error => console.error(error));
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/inquiry/donor';
$data = ['firstname' => 'Testfirstname',
'lastname' => 'Teslastname',
'email' => 'testing@test.com',
'phone' => '(555) 555-5555',
'website' => 'https://mywebsite.com',
'organization' => 'NYT',
'location_city' => 'New York City',
'location_state' => 'NY',
'location_country' => 'US',
'username' => '<EXPERT USERNAME>',
'donor_type' => 'not_for_profit',
'donor_focus' => 'other',
'message' => 'This is a test message to the expert...'];
$ch = curl_init($url);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$response = curl_exec($ch);
$json = json_decode($response);
if($json->success){
var_dump($json->data);
}
curl_close($ch);
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/inquiry/donor \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS TOKEN>" \
-d '{ "firstname": "Testfirstname","lastname": "Teslastname","email": "testing@test.com","phone": "(555) 555-5555","website": "https://mywebsite.com","organization": "NYT","location_city": "New York City","location_state": "NY","location_country": "US","username": "<EXPERT USERNAME>","donor_type": "not_for_profit","donor_focus": "other", "message": "This is a test message to the expert..." }'
Last updated