Spec - Companies
Table Of Contents
- Get Companies
- Add Companies
- Edit Companies
- Delete Companies
- Get Company-Level CRM Activities
- Add Company-Level CRM Activities
- Edit Company-Level CRM Activities
- Delete Company-Level CRM Activities
- Get Company Contacts
- Get Company CRM Activities
- Get Company Events Attended By Type
Get Companies
This function allows the caller to retrieve a list of companies from the database.
Search parameters should be specified inside the tag.
‘scope’ returns companies from all the groups by default. Specify the ‘group_id’ and ‘scope’ to ‘group’ to return companies for contacts under this group.
‘has_contacts’ filters companies that only has contacts in them.
‘scope’ and ‘has_contacts’ can be used together.
Input
- group_id (required)
- account_id (required for shared access)
- company_id
- search
- scope (all/group)
- has_contacts (true/false)
- include_user_defined_fields (true/false)
Output
Success or failure. List of companies.
Example Request
<GetCompaniesRequest group_id="4"></GetCompaniesRequest>
Example Request
<GetCompaniesRequest group_id="4" company_id="5"></GetCompaniesRequest>
Example Request (search company name)
<GetCompaniesRequest group_id="4" search='Appl'></GetCompaniesRequest>
Example Request (filter companies within this group)
<GetCompaniesRequest group_id="4" scope="group"></GetCompaniesRequest>
Example Request (filter companies that has contacts)
<GetCompaniesRequest group_id="4" has_contacts="true"></GetCompaniesRequest>
Example Request (filter companies within this group that has contacts)
<GetCompaniesRequest group_id="4" scope="group" has_contacts="true"></GetCompaniesRequest>
Example Request (include company user-defined fields)
<GetCompaniesRequest group_id="4" include_user_defined_fields="true"></GetCompaniesRequest>
Successful Response
<GetCompaniesResponse>
<Result>Success</Result>
<Companies>
<Company>
<CompanyID>1</CompanyID>
<CompanyName>Test Company 1</CompanyName>
<CompanyEmail>testcompany@gmail.com</CompanyEmail>
<Address>test</Address>
<City>Test City</City>
<State>Test State</State>
<Zip>31900</Zip>
<Country>United States</Country>
<Website>http://google.com</Website>
<Phone>012321321</Phone>
<PrimaryContactID></PrimaryContactID>
<SecondaryContactID></SecondaryContactID>
<ParentCompany></ParentCompany>
<CompanyInfo><p><em><strong>The quick brown fox jumps over the lazy dog.</strong></em></p></CompanyInfo>
<NumberOfContacts>2</NumberOfContacts>
<NumberOfCompanyLevelCRMActivities>0</NumberOfCompanyLevelCRMActivities>
<NumberOfTickets>0</NumberOfTickets>
<NumberOfOpportunities>0</NumberOfOpportunities>
<NumberOfCRMActivities>0</NumberOfCRMActivities>
<NumberOfEventsAttendedByType>0</NumberOfEventsAttendedByType>
<UserDefinedFields>
<UserDefinedField>
<UserFieldID>1</UserFieldID>
<FieldName>Fruit</FieldName>
<FieldValue>Apple</FieldValue>
</UserDefinedField>
<UserDefinedField>
<UserFieldID>14</UserFieldID>
<FieldName>Animal</FieldName>
<FieldValue>Dog</FieldValue>
</UserDefinedField>
</UserDefinedFields>
</Company>
<Company>
<CompanyID>2</CompanyID>
<CompanyName>Waveright CO.</CompanyName>
<CompanyEmail></CompanyEmail>
<Address></Address>
<City></City>
<State></State>
<Zip></Zip>
<Country></Country>
<Website></Website>
<Phone></Phone>
<PrimaryContactID></PrimaryContactID>
<SecondaryContactID></SecondaryContactID>
<ParentCompany></ParentCompany>
<CompanyInfo></CompanyInfo>
<NumberOfContacts>1</NumberOfContacts>
<NumberOfCompanyLevelCRMActivities>0</NumberOfCompanyLevelCRMActivities>
<NumberOfTickets>0</NumberOfTickets>
<NumberOfOpportunities>0</NumberOfOpportunities>
<NumberOfCRMActivities>0</NumberOfCRMActivities>
<NumberOfEventsAttendedByType>0</NumberOfEventsAttendedByType>
<UserDefinedFields>
<UserDefinedField>
<UserFieldID>1</UserFieldID>
<FieldName>Fruit</FieldName>
<FieldValue>Apple</FieldValue>
</UserDefinedField>
<UserDefinedField>
<UserFieldID>14</UserFieldID>
<FieldName>Animal</FieldName>
<FieldValue>Dog</FieldValue>
</UserDefinedField>
</UserDefinedFields>
</Company>
<Company>
<CompanyID>3</CompanyID>
<CompanyName>Acme Widgets, LLC</CompanyName>
<CompanyEmail></CompanyEmail>
<Address></Address>
<City></City>
<State></State>
<Zip></Zip>
<Country></Country>
<Website></Website>
<Phone></Phone>
<PrimaryContactID></PrimaryContactID>
<SecondaryContactID></SecondaryContactID>
<ParentCompany></ParentCompany>
<CompanyInfo></CompanyInfo>
<NumberOfContacts>1</NumberOfContacts>
<NumberOfCompanyLevelCRMActivities>0</NumberOfCompanyLevelCRMActivities>
<NumberOfTickets>0</NumberOfTickets>
<NumberOfOpportunities>0</NumberOfOpportunities>
<NumberOfCRMActivities>0</NumberOfCRMActivities>
<NumberOfEventsAttendedByType>0</NumberOfEventsAttendedByType>
<UserDefinedFields>
<UserDefinedField>
<UserFieldID>1</UserFieldID>
<FieldName>Fruit</FieldName>
<FieldValue>Apple</FieldValue>
</UserDefinedField>
<UserDefinedField>
<UserFieldID>14</UserFieldID>
<FieldName>Animal</FieldName>
<FieldValue>Dog</FieldValue>
</UserDefinedField>
</UserDefinedFields>
</Company>
</Companies>
</GetCompaniesResponse>
Add Companies
This function allows the caller to add companies.
Search parameters should be specified inside the tag.
The caller must have contacts access permissions to an account in order to this action.
Input
- account_id
- group_id
- request_id (optional)
- Company Name
- Address
- City
- State
- Zip
- Country
- Website
- Phone
- Primary Contact ID
- Secondary Contact ID
- Parent Company
- Company Info
- UserDefinedFields (fieldnum/fieldname)
Output
Success or failure for each companies. Company ID.
Example Request
<AddCompaniesRequest group_id="4">
<Companies>
<Company request_id="a1b2c3">
<CompanyName>Sample Company</CompanyName>
<CompanyEmail>testcompany@gmail.com</CompanyEmail>
<Address>123, Address 1</Address>
<City>City</City>
<State>State</State>
<Zip>12345</Zip>
<Country>United States</Country>
<Website>google.com</Website>
<Phone>1231234</Phone>
<ParentCompany></ParentCompany>
<CompanyInfo>Sample company info</CompanyInfo>
<UserDefinedFields>
<UserDefinedField fieldnum="123">Apple</UserDefinedField>
<UserDefinedField fieldname="Animal">Dog</UserDefinedField>
</UserDefinedFields>
</Company>
</Companies>
</AddCompaniesRequest>
Successful Response
<AddCompaniesResponse>
<Companies>
<Company request_id="a1b2c3">
<Result>Success</Result>
<CompanyID>15</CompanyID>
</Company>
</Companies>
</AddCompaniesResponse>
Edit Companies
This function allows the caller to modify one or more companies already in the database.
Search parameters should be specified inside the tag, while parameters to change to would be specified individually.
The caller must have contacts access permissions to an account in order to this action.
Input
- account_id
- group_id
- company_id
- request_id (optional)
- Company Name
- Address
- City
- State
- Zip
- Country
- Website
- Phone
- Primary Contact ID
- Secondary Contact ID
- Parent Company
- Company Info
- UserDefinedFields (fieldnum/fieldname)
Output
Success or failure for each companies. Company ID.
Example Request
<EditCompaniesRequest group_id="4">
<Companies>
<Company company_id="15" request_id="a1b2c3">
<CompanyName>Edited Sample Company</CompanyName>
<CompanyEmail>testcompany@gmail.com</CompanyEmail>
<Address>123, Address 1</Address>
<City>City</City>
<State>State</State>
<Zip>12345</Zip>
<Country>United States</Country>
<Website>google.com</Website>
<Phone>1231234</Phone>
<ParentCompany></ParentCompany>
<CompanyInfo><p>Sample company info</p></CompanyInfo>
<UserDefinedFields>
<UserDefinedField fieldnum="123">Apple</UserDefinedField>
<UserDefinedField fieldname="Animal">Dog</UserDefinedField>
</UserDefinedFields>
</Company>
</Companies>
</EditCompaniesRequest>
Example Response
<EditCompaniesResponse>
<Companies>
<Company request_id="a1b2d3">
<Result>Success</Result>
<CompanyID>15</CompanyID>
</Company>
</Companies>
</EditCompaniesResponse>
Delete Companies
This function allows the caller to delete one or more companies from the database.
Search parameters should be specified inside the tag.
The caller must have contacts access permissions to an account in order to this action.
Input
- account_id
- group_id
- company_id
- request_id (optional)
Output
Success or failure for each companies. Company ID.
Example Request
<DeleteCompaniesRequest group_id="4">
<Companies>
<Company company_id="15" request_id="a1b2c3"/>
</Companies>
</DeleteCompaniesRequest>
Example Response
<DeleteCompaniesResponse>
<Companies>
<Company request_id="a1b2c3">
<Result>Success</Result>
<CompanyID>15</CompanyID>
</Company>
</Companies>
</DeleteCompaniesResponse>
Get Company-Level CRM Activities
This function allows the caller to retrieve company-level CRM activities from the database.
Search parameters should be specified inside the tag.
The caller must have contacts access permissions to an account in order to this action.
Input
- account_id (required for shared access)
- group_id
- company_id
- activity_id
- show_assignables
Output
Success or failure. A list of company-level CRM activities.
Example Request
<GetCompanyLevelCRMActivitiesRequest group_id="4" company_id="1" show_assignables="true"></GetCompanyLevelCRMActivitiesRequest>
Example Request
<GetCompanyLevelCRMActivitiesRequest group_id="4" activity_id="49"></GetCompanyLevelCRMActivitiesRequest>
Successful Response
<GetCompanyLevelCRMActivitiesResponse>
<Result>Success</Result>
<CRMActivities>
<CRMActivity>
<ActivityID>49</ActivityID>
<Activity>Make Note</Activity>
<GroupID>1</GroupID>
<CompanyID>1</CompanyID>
<OpportunityID></OpportunityID>
<DoneByContactID>0</DoneByContactID>
<DoneByFirstname></DoneByFirstname>
<DoneByLastname></DoneByLastname>
<DoneDate>2015-03-09 11:10:00</DoneDate>
<DueDate>2015-03-14 11:45:00</DueDate>
<Priority>Normal</Priority>
<Notes>Tset</Notes>
</CRMActivity>
</CRMActivities>
<AssignableContacts>
<AssignableContact>
<ContactID>0</ContactID>
<Name>Todd Wade</Name>
<Email></Email>
</AssignableContact>
<AssignableContact>
<ContactID>5</ContactID>
<Name>NCA Wade</Name>
<Email>someone.nca@gmail.com</Email>
</AssignableContact>
</AssignableContacts>
</GetCompanyLevelCRMActivitiesResponse>
Add Company-Level CRM Activities
This function allows the caller to add one or more company-level CRM activities.
The caller must have contacts access permissions to an account in order to this action.
Input
- account_id
- group_id
- request_id (optional)
- Company ID
- Done By Contact ID
- Group ID
- Done Date (YYYYMMDDHHMM format)
- Due Date (YYYYMMDDHHMM format)
- Activity
- Notes
Output
Success or failure for each company-level CRM activities. Company-level CRM activity ID.
Example Request
<AddCompanyLevelCRMActivitiesRequest group_id="4">
<CRMActivities>
<CRMActivity request_id="a1b2c3">
<CompanyID>1</CompanyID>
<DoneByContactID>0</DoneByContactID>
<GroupID>4</GroupID>
<DoneDate>202206220257</DoneDate>
<DueDate>202206220257</DueDate>
<Activity>Make Note</Activity>
<Notes>Sample notes</Notes>
</CRMActivity>
</CRMActivities>
</AddCompanyLevelCRMActivitiesRequest>
Successful Response
<AddCompanyLevelCRMActivitiesResponse>
<CRMActivities>
<CRMActivity request_id="a1b2c3">
<Result>Success</Result>
<ActivityID>51</ActivityID>
</CRMActivity>
</CRMActivities>
</AddCompanyLevelCRMActivitiesResponse>
Edit Company-Level CRM Activities
This function allows the caller to modify one or more company-level CRM activities already in the database.
Search parameters should be specified inside the tag, while parameters to change to would be specified individually.
The caller must have contacts access permissions to an account in order to this action.
Input
- account_id
- group_id
- activity_id
- company_id
- request_id (optional)
- Group ID
- Done Date (YYYYMMDDHHMM format)
- Due Date (YYYYMMDDHHMM format)
- Activity
- Notes
Output
Success or failure for each company-level CRM activities. Company-level CRM activity ID.
Example Request
<EditCompanyLevelCRMActivitiesRequest group_id="4">
<CRMActivities>
<CRMActivity activity_id="51" company_id="1" request_id="a1b2c3">
<DoneByContactID>0</DoneByContactID>
<GroupID>4</GroupID>
<DoneDate>202206220257</DoneDate>
<DueDate>202206220257</DueDate>
<Activity>Make Note</Activity>
<Notes>Sample notes</Notes>
</CRMActivity>
</CRMActivities>
</EditCompanyLevelCRMActivitiesRequest>
Example Response
<EditCompanyLevelCRMActivitiesResponse>
<CRMActivities>
<CRMActivity request_id="a1b2c3">
<Result>Success</Result>
<ActivityID>51</ActivityID>
<CompanyID>1</CompanyID>
</CRMActivity>
</CRMActivities>
</EditCompanyLevelCRMActivitiesResponse>
Delete Company-Level CRM Activities
This function allows the caller to delete one or more company-level CRM activities from the database.
Search parameters should be specified inside the tag.
The caller must have contacts access permissions to an account in order to this action.
Input
- account_id
- group_id
- activity_id
- company_id
- request_id (optional)
Output
Success or failure for each company-level CRM activities. List of company-level CRM activities.
Example Request
<DeleteCompanyLevelCRMActivitiesRequest group_id="4">
<CRMActivities>
<CRMActivity activity_id="51" company_id="1" request_id="a1b2c3"/>
</CRMActivities>
</DeleteCompanyLevelCRMActivitiesRequest>
Example Response
<DeleteCompanyLevelCRMActivitiesResponse>
<CRMActivities>
<CRMActivity request_id="a1b2c3">
<Result>Success</Result>
<ActivityID>51</ActivityID>
<CompanyID>1</CompanyID>
</CRMActivity>
</CRMActivities>
</DeleteCompanyLevelCRMActivitiesResponse>
Get Company Contacts
This function allows the caller to retrieve a company’s contacts from the database.
Search parameters should be specified inside the tag.
The caller must have contacts access permissions to an account in order to this action.
Input
- account_id (required for shared access)
- group_id
- company_id
Output
Success or failure. A list of company’s contacts.
Example Request
<GetCompanyContactsRequest group_id="4" company_id="1"></GetCompanyContactsRequest>
Successful Response
<GetCompanyContactsResponse>
<Result>Success</Result>
<Contacts>
<Contact>
<Contact_id>123</Contact_id>
<Firstname>Testfirst1 & and " '</Firstname>
<Lastname>Test1 & 2</Lastname>
<Email>contact+test1@gmail.com</Email>
<Title></Title>
<Phone>(012) 111-111</Phone>
</Contact>
<Contact>
<Contact_id>2</Contact_id>
<Firstname>Test</Firstname>
<Lastname>Wade</Lastname>
<Email>another+contact@gmail.com</Email>
<Title></Title>
<Phone>330 555 1212</Phone>
</Contact>
</Contacts>
</GetCompanyContactsResponse>
Get Company CRM Activities
This function allows the caller to retrieve a company’s CRM activities from the database.
Search parameters should be specified inside the tag.
The caller must have contacts access permissions to an account in order to this action.
Input
- account_id (required for shared access)
- group_id
- activity_id
- company_id
Output
Success or failure. A list of company’s CRM activities.
Example Request
<GetCompanyCRMActivitiesRequest group_id="4" company_id="1"></GetCompanyCRMActivitiesRequest>
Example Request
<GetCompanyCRMActivitiesRequest group_id="4" activity_id="46"></GetCompanyCRMActivitiesRequest>
Successful Response
<GetCompanyCRMActivitiesResponse>
<Result>Success</Result>
<CRMActivities>
<CRMActivity>
<ActivityID>46</ActivityID>
<Activity>Make Note</Activity>
<ContactID>123</ContactID>
<ContactFirstname>Testfirst1 & and " '</ContactFirstname>
<ContactLastname>Test1 & 2</ContactLastname>
<GroupID>4</GroupID>
<CompanyID>1</CompanyID>
<OpportunityID>0</OpportunityID>
<DoneByContactID>0</DoneByContactID>
<DoneByFirstname></DoneByFirstname>
<DoneByLastname></DoneByLastname>
<DoneDate>201503171020</DoneDate>
<DueDate></DueDate>
<Priority>Normal</Priority>
<Notes></Notes>
</CRMActivity>
<CRMActivity>
<ActivityID>47</ActivityID>
<Activity>Follow-Up</Activity>
<ContactID>123</ContactID>
<ContactFirstname>Testfirst1 & and " '</ContactFirstname>
<ContactLastname>Test1 & 2</ContactLastname>
<GroupID>1</GroupID>
<CompanyID>1</CompanyID>
<OpportunityID></OpportunityID>
<DoneByContactID>5</DoneByContactID>
<DoneByFirstname>NCA</DoneByFirstname>
<DoneByLastname>Wade</DoneByLastname>
<DoneDate></DoneDate>
<DueDate>201502191102</DueDate>
<Priority>Normal</Priority>
<Notes>Reply to his email about studs</Notes>
</CRMActivity>
<CRMActivity>
<ActivityID>4</ActivityID>
<Activity>Phone Call</Activity>
<ContactID>2</ContactID>
<ContactFirstname>Test</ContactFirstname>
<ContactLastname>Wade</ContactLastname>
<GroupID>1</GroupID>
<CompanyID></CompanyID>
<OpportunityID></OpportunityID>
<DoneByContactID>0</DoneByContactID>
<DoneByFirstname></DoneByFirstname>
<DoneByLastname></DoneByLastname>
<DoneDate>20140420061000</DoneDate>
<DueDate></DueDate>
<Priority>Normal</Priority>
<Notes>gave user a call; again</Notes>
</CRMActivity>
</CRMActivities>
</GetCompanyCRMActivitiesResponse>
Get Company Events Attended By Type
This function allows the caller to retrieve a company’s events attend by type from the database.
Search parameters should be specified inside the tag.
The caller must have contacts access permissions to an account in order to this action.
Input
- account_id (required for shared access)
- group_id
- company_id
Output
Success or failure. A list of company’s events attended by type.
Example Request
<GetCompanyEventsAttendedByTypeRequest group_id="4" company_id="1"></GetCompanyEventsAttendedByTypeRequest>
Successful Response
<GetCompanyEventsAttendedByTypeResponse>
<Result>Success</Result>
<EventsAttendedByType>
<Event>
<EventType>Course</EventType>
<Attendees>1</Attendees>
</Event>
</EventsAttendedByType>
</GetCompanyEventsAttendedByTypeResponse>