3.0
API change historyREST API with full access to Enquire Objects and meta-data for CRUD operations.
Activity POST
Activities are used to store a users actions against Individuals. All reporting functionality and sale stage progress are tracked using Activities.
You can use this method to create Activities for an Individual and User. You can also schedule activities to be completed by Enquire CRM users or denote that an Activity has taken place for a Individual for reporting purposes.
Activities help determine the Sale Stage of Individual.
Activity Status Masters
- Assigned = 1
- In Progress = 2
- Completed = 3
- Cancelled = 4
- Rescheduled = 5
- Noshow = 6
- Appointment set = 7
- Reschedule = 8
Activity Type Masters
- Inquiry = 1
- Call Out = 2
- Email In = 3
- Mail Out = 5
- Deposit = 6
- Assessment = 7
- Transfer = 9
- Other = 10
- Tour = 11
- Appointment = 12
- Home Visit = 14
- Walk-in = 15
- Meeting = 16
- Web Form = 17
- Move In = 18
- Reschedule = 19
- Move Out = 20
- Referral = 21
- To Do = 22
- Email Out = 24
- Call In = 26
- Outreach Appointment = 27
- Outreach Call In = 28
- Outreach Call Out = 29
- Event = 30
- Mass Email = 31
- Mass Mail = 32
- Contract Signed = 33
- Pre-Admit = 34
- Paperwork = 35
- Admission = 36
- Respond to Referral = 37
- Room Reserve = 38
- Leave = 39
- Leave Return = 40
- Update = 41
Request
Request URL
Request parameters
-
number
This is your company Id. You can request this value from EnquireLEADS support when registering for the API.
Request headers
-
(optional)stringMedia type of the body sent to the API.
Request body
Creates an activity for an individual. There is a minimum of two required fields:
- ActivityTypeId - You can retrieve this from the Type GET method
- Start - The date the activity occurred.
You can retrieve the following Type Id's using the Type GET method
- Market Source Type (https://api2.enquiresolutions.com/v3/Type[?PortalId])&TypeId=4)
- Campaign (https://api2.enquiresolutions.com/v3/Campaign/[?Portalid])
- Activity Type (https://api2.enquiresolutions.com/v3/Type[?PortalId])&TypeId=7)
- Activity Status (https://api2.enquiresolutions.com/v3/Type[?PortalId])&TypeId=6)
- Activity Result (https://api2.enquiresolutions.com/v3/Type[?PortalId])&TypeId=38)
- User (https://api2.enquiresolutions.com/v3/Type[?PortalId])&TypeId=53)
When creating an activity for an individual you can either use the IndividualId or CaseNumber. Including both in the same request is not required.
{
"activities": [
{
"assignedUserId": 32,
"individualId": 1234567,
"caseNumber": "DEMO00001",
"allday": false,
"start": "2016-03-22T05:19:12.7401673-06:00",
"end": "2016-03-22T05:34:12.7401673-06:00",
"datecompleted": "2016-03-22T05:19:12.7401673-06:00",
"marketSourceId": 132,
"marketSource": null,
"reInquiry": true,
"campaignId": 22,
"description": "Web Form Inquiry",
"notes": [
{
"Message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
},
{
"Message": "Sed ut perspiciatis unde omnis iste natust"
}
],
"communities": [
{
"NameUnique": "Community1"
},
{
"NameUnique": "Community2"
}
],
"activityTypeId": 23,
"activityTypeMasterId": 17,
"activityStatusId": 412,
"activityStatusMasterId" : null,
"activityResultId": 232
}
]
}
Responses
201 Created
Activity was created
Code samples
@ECHO OFF
curl -v -X POST "https://api2.enquiresolutions.com/v3/Activity?PortalId={number}"
-H "Content-Type: application/json"
-H "Ocp-Apim-Subscription-Key: {subscription key}"
--data-ascii "{body}"
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;
namespace CSHttpClientSample
{
static class Program
{
static void Main()
{
MakeRequest();
Console.WriteLine("Hit ENTER to exit...");
Console.ReadLine();
}
static async void MakeRequest()
{
var client = new HttpClient();
var queryString = HttpUtility.ParseQueryString(string.Empty);
// Request headers
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");
// Request parameters
queryString["PortalId"] = "{number}";
var uri = "https://api2.enquiresolutions.com/v3/Activity?" + queryString;
HttpResponseMessage response;
// Request body
byte[] byteData = Encoding.UTF8.GetBytes("{body}");
using (var content = new ByteArrayContent(byteData))
{
content.Headers.ContentType = new MediaTypeHeaderValue("< your content type, i.e. application/json >");
response = await client.PostAsync(uri, content);
}
}
}
}
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
public class JavaSample
{
public static void main(String[] args)
{
HttpClient httpclient = HttpClients.createDefault();
try
{
URIBuilder builder = new URIBuilder("https://api2.enquiresolutions.com/v3/Activity");
builder.setParameter("PortalId", "{number}");
URI uri = builder.build();
HttpPost request = new HttpPost(uri);
request.setHeader("Content-Type", "application/json");
request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
// Request body
StringEntity reqEntity = new StringEntity("{body}");
request.setEntity(reqEntity);
HttpResponse response = httpclient.execute(request);
HttpEntity entity = response.getEntity();
if (entity != null)
{
System.out.println(EntityUtils.toString(entity));
}
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>JSSample</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function() {
var params = {
// Request parameters
"PortalId": "{number}",
};
$.ajax({
url: "https://api2.enquiresolutions.com/v3/Activity?" + $.param(params),
beforeSend: function(xhrObj){
// Request headers
xhrObj.setRequestHeader("Content-Type","application/json");
xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
},
type: "POST",
// Request body
data: "{body}",
})
.done(function(data) {
alert("success");
})
.fail(function() {
alert("error");
});
});
</script>
</body>
</html>
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString* path = @"https://api2.enquiresolutions.com/v3/Activity";
NSArray* array = @[
// Request parameters
@"entities=true",
@"PortalId={number}",
];
NSString* string = [array componentsJoinedByString:@"&"];
path = [path stringByAppendingFormat:@"?%@", string];
NSLog(@"%@", path);
NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
[_request setHTTPMethod:@"POST"];
// Request headers
[_request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
// Request body
[_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
NSURLResponse *response = nil;
NSError *error = nil;
NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];
if (nil != error)
{
NSLog(@"Error: %@", error);
}
else
{
NSError* error = nil;
NSMutableDictionary* json = nil;
NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
NSLog(@"%@", dataString);
if (nil != _connectionData)
{
json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
}
if (error || !json)
{
NSLog(@"Could not parse loaded json with error:%@", error);
}
NSLog(@"%@", json);
_connectionData = nil;
}
[pool drain];
return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';
$request = new Http_Request2('https://api2.enquiresolutions.com/v3/Activity');
$url = $request->getUrl();
$headers = array(
// Request headers
'Content-Type' => 'application/json',
'Ocp-Apim-Subscription-Key' => '{subscription key}',
);
$request->setHeader($headers);
$parameters = array(
// Request parameters
'PortalId' => '{number}',
);
$url->setQueryVariables($parameters);
$request->setMethod(HTTP_Request2::METHOD_POST);
// Request body
$request->setBody("{body}");
try
{
$response = $request->send();
echo $response->getBody();
}
catch (HttpException $ex)
{
echo $ex;
}
?>
########### Python 2.7 #############
import httplib, urllib, base64
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.urlencode({
# Request parameters
'PortalId': '{number}',
})
try:
conn = httplib.HTTPSConnection('api2.enquiresolutions.com')
conn.request("POST", "/v3/Activity?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.parse.urlencode({
# Request parameters
'PortalId': '{number}',
})
try:
conn = http.client.HTTPSConnection('api2.enquiresolutions.com')
conn.request("POST", "/v3/Activity?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
require 'net/http'
uri = URI('https://api2.enquiresolutions.com/v3/Activity')
query = URI.encode_www_form({
# Request parameters
'PortalId' => '{number}'
})
if uri.query && uri.query.length > 0
uri.query += '&' + query
else
uri.query = query
end
request = Net::HTTP::Post.new(uri.request_uri)
# Request headers
request['Content-Type'] = 'application/json'
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"
response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
http.request(request)
end
puts response.body