MarketSharp API Documentation
Assistance
MarketSharp does not actively support the API. Code creation and debugging are beyond the scope of our support. We will help if there is a problem generating the keys, or there is some question as to whether the API Is active for you. If you have an issue along those lines please contact Customer Care at 1-800-596-4368 or support@marketsharp.com.
Overview
The MarketSharp API is a read-only API using OData protocol.
Connecting
You will need the company ID (also called a COY), the user API key, and the secret key. These keys can be retrieved from MarketSharp via the admin link and going to the section titled Apps & Add-ons Setup, and then clicking the link for API Maintenance. We have sample code in both C# and Java available to download on this page as well.
The request method should be of type GET. For any request you will need to set the request header for authorization. The value will consist of the company ID, API key, the current Unix epoch time (in whole seconds), and a hash. We create the hash using HMACSHA256. Create the hashing function using the secret key after converting it from base 64 to a string, and then create the hash using the company ID, API key, and epoch concatenated together as your input. The form of the authorization value is (including the colons) companyID:APIkey:epoch:hash. With your authorization headers set you’ll be able to make requests at https://api4.marketsharpm.com/WcfDataService.svc.
For an example of how to generate an authorization token, copy the following code into https://onlinephp.io/ and populate the coy (company id), api key, and secret key. When making Postman requests, make sure authorization is set to No Auth, and set an authorization header yourself using the authstring as the value.
If you have Postman (https://www.getpostman.com/) you can use it to test that you have the connection information correctly entered. Create a new request and save it in a collection of your choice. Make sure it is a GET request, set Authorization to “No Auth”. Go to headers and add a key set to Authorization and set the corresponding value to the authorization value that you generated above. To make a simple test request, in MarketSharp use the Quick Find to find a contact and copy the value for contactOid from the browser’s address field. Change the address to reflect it https://api4.marketsharpm.com/WcfDataService.svc/Contacts('<contactoid>') and hit send. You should get back the contact’s information. In general it should be a simple matter to analyze the relationship links to see how to pull other information from the system. What follows is a reference to what entities contain what information and their relationship links.
Retrieving Data
Contacts, Prospects, Leads, and Customers
Example requests
https://api4.marketsharpm.com/WcfDataService.svc/Contacts
https://api4.marketsharpm.com/WcfDataService.svc/Contacts(‘<contactoid>’)
https://api4.marketsharpm.com/WcfDataService.svc/Prospects
https://api4.marketsharpm.com/WcfDataService.svc/Leads
https://api4.marketsharpm.com/WcfDataService.svc/Customers
Relationship Links
ContactType
ContactPhone
Job
Inquiry
Address
AdditionalContact
Company
CustomField
Activity
FutureInterest
Note
C800ResponseLead
Minus any specific criteria these will pull a listing of contacts, limit 5000. The following data is pulled per contact:
id
companyId
firstName
lastName
middleInitial
title
incomeCode
ageCode
structureAgeCode
reference
businessName
contactPhoneId
primaryAddressId
website1
website2
website3
email1
email1CanMail (Boolean type)
email2
email2CanMail (Boolean type)
email3
email3CanMail (Boolean type)
isTagged (Boolean type)
structureValueCode
doNotMail (Boolean type)
yearHomeBuilt
maritalStatus
lengthOfResidence
styleOfHome
mailMergeName
source
creationDate (DateTime type)
qbSyncDate (DateTime type)
qbId
isActive (Boolean type)
lastUpdate (DateTime type)
hasDNCPhone (Boolean type)
hasDNEEmail (Boolean type)
qbEditSequence
qbSyncData (Boolean type)
qbName
createdDate (DateTime type)
Contact Type
Example requests:
https://api4.marketsharpm.com/WcfDataService.svc/ContactTypes(‘<contactoid>’)
https://api4.marketsharpm.com/WcfDataService.svc/Contacts(‘<contactoid>’)/ContactType
Relationship Links
Contacts
ContactType
ContactPhone
Job
Inquiry
Address
AdditionalContact
Company
CustomField
Activity
FutureInterest
Note
C800ResponseLead
The following data is returned by these requests:
id
contactId
contactType
isActive (Boolean type)
Address
Example requests:
https://api4.marketsharpm.com/WcfDataService.svc/Contacts('<ContactId>')/Address
Relationship Links
Contact
Returns the following data:
id
contactId
line1
city
state
coounty
zip
country
carrierRoute
cass
latitude
longitude
zip4
dpbc2
barCode
line2
isActive
Contact Phone
Example requests:
https://api4.marketsharpm.com/WcfDataService.svc/ContactPhones(‘<contactoid>’)
https://api4.marketsharpm.com/WcfDataService.svc/Contacts(‘<contactoid>’)/ContactPhone
The following data is returned by these requests:
contactId
assistantPhone
workFax
cellPhone
companyPhone
homePhone2
homeFax
pager
workPhone2
companyFax
homePhone
workPhone
otherPhone
cellPhone2
otherPhone2
Additional Contacts
Example requests:
Relationship Links
AdditionalContacts
Contact
The following data is returned by these requests:
id
contactId
title
firstName
lastName
line
line2
city
state
zip
homePhone
workPhone
cellphone
email1
note
relationship
isActive (Boolean type)
Custom Fields
Example requests:
Relationship Links
CustomFields
Contact
The following data is returned by these requests:
id
name
value
contactId
Inquiries
Example Request
https://api4.marketsharpm.com/WcfDataService.svc/Contacts(‘<contactoid>’)/Inquiry
https://api4.marketsharpm.com/WcfDataService.svc//Inquiries(‘<InquiryId>’)
Relationship Links
Appointment
LeadPaint
InquirySourcePrimary
InquirySourceSecondary
Canvasser
Promoter
Telemarketer
ProductInterest
SetBy
Activity
InquiryStatus
Retrieves inquiry information for a given contact. Returns the following data:
id
contactId
description
inquirySourcePrimaryId
creationDate (DateTime type)
inquirySourceSecondaryId
inquiryDate (DateTime type)
setDate (DateTime type)
note
promoterId
canvasserId
telemarketerId
jobSiteAddressLine1
jobSiteAddressLine2
jobSiteCity
jobSiteState
jobSiteZip
jobSiteDirections
isActive (Boolean type)
setById
division
inquiryStatusId (Int32 type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
Product Interests
Relationship Links
ProductInterests
Inquiry
ProductType
ProductDetail
Returns the following data:
id
inquiryId
productTypeId
priceQuoted (Decimal type)
isActive (Boolean type)
lastUpdate (DateTime type)
productDetailId
Inquiry Statuses
Relationship Links
InquiryStatuses
Company
Inquiry
Returns the following data:
id (Int32 type)
companyId
name
isActive (Boolean type)
lastUpdateBy
lastUpdateUtc (DateTime type)
createdBy
createdDateUtc (DateTime type)
Appointments
Relationship Links
Appointments
Job
Inquiry
AppointmentResult
Salesperson1
Salesperson2
SetBy
Proposal
Activity
Returns the following data:
id
inquiryId
salesperson1Id
appointmentDate (DateTime type)
note
resultId
resultReason
setDate (DateTime type)
subject
type
salesperson2Id
issuedDate (DateTime type)
isActive (Boolean type)"
lastUpdate (DateTime type)
setById
lastUpdateBy
createdDate (DateTime type)
createdBy
Appointment Results
Relationship Links
AppointmentResults
Appointment
Returns the following data:
id
name
presentation (type Boolean)
sold (type Boolean)
isActive (type Boolean)
Proposals
Relationship Links
Proposals
Appointment
Returns the following data:
id
companyId
appointmentId
status
date (DateTime type)
sent (Boolean type)
priceQuoted (Decimal type)
discountOffered (Decimal type)
discountedPrice (Decimal type)
note
dateDelivered (DateTime type)
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
Sold Appointments
Jobs
Relationship Links
Jobs
Contact
Contract
JobProduct
Appointment
LeadPaint
Survey
Returns the following data:
id
contactId
inquiryId
site
number
name
description
type
status
addressLine1
addressLin2
city
state
zip
structureValueCode
note
startDate (DateTime type)
saleDate (DateTime type)
completedDate (DateTime type)
appointmentId
isActive (Boolean type)
lastUpdate (DateTime type)
createdDate (DateTime type)
exportedToGuildQuality (Boolean type)
Contract
Relationship Links
Contracts
Job
PaymentHistory
Loan
Returns the following data:
Id
jobId
contractDate (DateTime type)
status
completedDate (DateTime type)
gross (Decimal type)
grossPercent (Single type)
paymentType
financeTotal (Decimal type)
cashTotal (Decimal type)
balanceDue (Decimal type)
totalContract (Decimal type)
isActive (Boolean type)
Product
Work Crew
Relationship Links
WorkCrews
Company
JobProduct
Returns the following data:
id (Guid type)
name
companyId
isActive (Boolean type)
Job Product Details
Relationship Links
JobProductDetails
JobProduct
ProductDetail
Returns the following data:
id
jobProductId
productDetailId
quantity
unit
note
definable1
definable2
definable3
price (Decimal type)
isActive (Boolean type)
Lead Paints
Relationship Links
LeadPaints
Job
Inquiry
LeadPaintAttachment
LeadPaintToFirm
LeadPaintToRenovator
LeadPaintToWorker
Company
Returns the following data:
id (Guid type)
inquiryId
jobId
yearBuilt
pre1978 (Int32 type)
hasLeadPaint (Int32 type)
housingType (Int32 type)
childOccupied (Int32 type)
isActive (Boolean type)
companyId
Lead Paint Attachments
Relationship Links
LeadPaintAttachments
LeadPaint
Company
Returns the following data:
id (Guid type)
leadPaintId (Guid type)
date (DateTime type)
type (Int32 type)
description
attachmentPath
attachmentFileName
isActive (Boolean type)
companyId
Lead Paint attachment by ID
Lead Paint Firms
Relationship Links
LeadPaintFirms
LeadPaint
LeadPaintRenovator
LeadPaintWorker
Returns the following data:
id (Guid type)
name
address
city
state
zip
phone
certificationNumber
isActive (Boolean type)
Lead Paint Renovators
Relationship Links
LeadPaintRenovators
LeadPaintFirm
LeadPaint
Returns the following data:
id (Guid type)
firmId (Guid type)
firstName
lastName
address
city
state
zip
phone
certificationNumber
isActive (Boolean type)
Lead Paint Workers
Relationship Links
LeadPaintWorkers
LeadPaintFirm
LeadPaint
Returns the following data:
id (Guid type)
firmId (Guid type)
firstName
lastName
address
city
state
zip
phone
isActive (Boolean type)
Lead Paint Renovator
Relationship Links
LeadPaintRenovators
LeadPaintFirm
LeadPaint
Returns the following data:
id (Guid type)
firmId (Guid type)
firstName
lastName
address
city
state
zip
phone
certificationNumber
isActive (Boolean type)
Product Details
Relationship Links
ProductDetails
ProductType
JobProductDetail
Company
ProductInterest
FutureInterest
Returns the following data:
Id
productTypeId
name
isActive (Boolean type)
companyId
Job Product Commissions
Relationship Links
JobProductCommissions
Salesperson
JobProduct
JobProductCommissionPayment
Returns the following data:
Id
companyId
jobProductId
commissionAmount (Decimal type)
salespersonId
adjustmentAmount (Decimal type)
adjustmentDescription
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
Job Product Commission Payments
Relationship Links
JobProductCommissionPayments
JobProductCommission
Returns the following data:
id
companyId
jobProductCommissionId
paymentAmount (Decimal type)
paymentDate (DateTime type)
paymentDescription
paymentNote
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
Job Product Costs
Relationship Links
JobProductCosts
JobProduct
JobProductCostType
Returns the following data:
Id
jobProductId
jobProductCostId
amount (Decimal type)
description
paidTo
date (DateTime type)
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
Job Product Cost Types
Relationship Links
JobProductCostTypes
JobProductCost
Returns the following data:
Id
companyId
type
code
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
Payment Histories
Relationship Links
PaymentHistories
Contract
Returns the following data:
Id
companyId
paymentType
contractId
paymentAmount (Decimal type)
paymentMethod
paymentDescription
paymentDate (DateTime type)
paymentAppliesTo
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
Loans
Relationship Links
Loans
Contract
Returns the following data:
Id
contractId
loanNumber
loanType
loanStatus
loanApprovedDate (DateTime type)
loanTerm
loanRate
loanCreditScore
financedBy
notes
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
Process Steps
Relationship Links
ProcessSteps
Company
JobProduct
Returns the following data:
Id
jobProductId
description>Products Ordered
actualStartDate (DateTime type)
actualEndDate (DateTime type)
assignedEmployeeId
expectedStartDate (DateTime type)
expectedEndDate (DateTime type)
stepOrder (Int32 type)
note
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
companyId
createdBy
createdDate (DateTime type)
Surveys
Relationship Links
Surveys
Job
Returns the following data:
Id
jobId
otherEstimates
purchaseReason
wouldReferOthers
overallSatisfaction
salesRepRating
officeStaffRating
installationCrewRating
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
valueOfHome
createdBy
createdDate (DateTime type)
Future Interests
Relationship Links
FutureInterests
Contact
ProductDetail
ProductType
Returns the following data:
Id
contactId
productTypeId
productDetailId
interestDate (DateTime type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
Service Orders
Relationship Links
ServiceOrders
JobProduct
Returns the following data:
Id
jobProductId
serviceNote
requestDate (DateTime type)
serviceDate (DateTime type)
completedDate (DateTime type)
technicianEmployeeId
status
serviceType
serviceAmount (Decimal type)
amountPaid (Decimal type)
isWarranty (Boolean type)
isBillable (Boolean type)
technicianNote
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
Activities
Sample requests
https://api4.marketsharpm.com/WcfDataService.svc/Contacts(<contactoid>)/Activity
https://api4.marketsharpm.com/WcfDataService.svc/Activities(‘activityoid')
Relationship Links
Contact
InquiryActivityResult
ActivityReference
Appointment
C800ResponseLead
Returns the following data:
id
contactId
name
type
completedDate
dueDate (DateTime type)
reminderMinutes (Int32 type)
notes
appointmentId
assignToEmployeeId
scheduledByEmployeeId
reminderDismissed (Boolean type)
isActive (Boolean type)
lastUpdatedBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
inquiryId
activityResultId (Int32 type)
activityReferenceId (Int32 type)
Activity Results
Sample requests
Relationship Links
ActivityResults
Company
Activity
Returns the following data:
id (Int32 type)
companyId
name
emailSuccess (Boolean type)
emailFailure (Boolean type)
confirmed (Boolean type)
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
countAsApptConfirmed (Boolean type)
countAsApptCreated (Boolean type)
countAsContacted (Boolean type)
Activity References
Sample requests
Relationship Links
ActivityReferences
Company
Activity
Returns the following data:
id (Int32 type
companyId
name
inquiryRequired (Boolean type)
appointmentRequired (Boolean type)
isActive (Boolean type)
createdBy
createdDateUtc (DateTime type)
lastUpdateUtc (DateTime type )
Notes
Sample Requests
Relationship Links
Notes
Contact
Returns the following data:
id
contactId
contactType
note
dateTime (DateTime type)
employeeId
isActive (Boolean type)
lastUpdateBy
lastUpdate (DateTime type)
createdBy
createdDate (DateTime type)
Companies
Sample Requests
Relationship Links
Companies
Contact
Employee
InquirySourceSecondary
ProductType
ProductDetail
InquirySourcePrimary
ActivityResult
InquiryStatus
C800ResponseLead
WorkCrew
Returns the following data:
id
number (Int32 type )
name
owner
addressLine1
addressLine2
addressCity
addressState
addressZip
website
contactName
contactTitle
phone
fax
timeZone
Employees
Sample Requests
https://api4.marketsharpm.com/WcfDataService.svc/Employees
https://api4.marketsharpm.com/WcfDataService.svc/Employees('EmployeeId')
Relationship Links
Company
Commission
EmployeeInfo
Returns the following data:
id
name
isActive (Boolean type)
lastUpdate (DateTime type)
companyId
Employee Info
Sample requests
Relationship Links
EmployeeInfoes
Employee
Returns the following data:
id
employeeId
userName
emailAddress
Employee Infoes
Sample requests
https://api4.marketsharpm.com/WcfDataService.svc/EmployeeInfoes
Relationship Links
Employee
EmployeeInfoes
Returns the following data:
Id
employeeId
userName
emailAddress
Product Types
Sample requests
https://api4.marketsharpm.com/WcfDataService.svc/ProductTypes
Relationship Links
ProductTypes
JobProduct
ProductDetail
Company
ProductInterest
FutureInterest
Returns the following data:
id
name
isActive (Boolean type)
companyId
Primary Lead Sources
Sample requests
https://api4.marketsharpm.com/WcfDataService.svc/InquirySourcePrimaries
Relationship Links
InquirySourcePrimaries
Inquiry
InquirySourceSecondary
Company
Returns the following data:
id
name
isActive (Boolean type)
companyId
Secondary Lead Sources
Sample requests
https://api4.marketsharpm.com/WcfDataService.svc/InquirySourceSecondaries
Relationship Links
InquirySourceSecondaries
Inquiry
InquirySourcePrimary
Company
Returns the following data:
id
inquirySourcePrimaryId>
isActive (Boolean type)
companyId
800Response Leads
Sample requests
https://api4.marketsharpm.com/WcfDataService.svc/C800ResponseLead
Relationship Links
C800ResponseLead
Contact
Company
Activity
Returns the following data:
id (Int32 type)
contactId
activityId
vendorLeadId
firstName
lastName
streetAddress
city
state
zip
caller
callTag
dialed
ringTo
date
time
duration
callRecordingRawLink
callRecordingLink
createdDateUtc (DateTime type)
companyId
dateTimeUtc
ringToLabel