Contacts APIs
-
List Contacts
Description: Returns an array of Contacts for the given Contact list.Usage:
GET api/ContactLists/Contacts/List/{ListCode}/{RowIndex}/{PageSize}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list RowIndex Int32 FromUri the starting row index for the page to get records from. The first row starts with 0. PageSize Int32 FromUri the total number of records to return in a page Returns:
Array of Contact objects
Examples:
<!-- Intent: gets the list of contacts in the contact list with ListCode 123456. This will return the first 5 rows. GET to the following url http://api.v4.swiftreach.com/api/ContactLists/Contacts/List/123456/1/5 --> <!-- No XML input is required --> <!-- example return value --> <ArrayOfContact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SwiftReach.Swift911.Core.ContactLists"> <Contact> <Addresses> <AddressProfile> <Address1>14 Industrial Ave</Address1> <Address2></Address2> <AddressGuid>22748f25-07b8-459c-bcef-ce2ba851a84c</AddressGuid> <City>Mahwah</City> <County></County> <IsPrimary>false</IsPrimary> <Label>Office</Label> <Latitude>41.052698269486427</Latitude> <Longitude>-74.121656566858292</Longitude> <PostalCode>07430</PostalCode> <State>NJ</State> </AddressProfile> </Addresses> <ChangeStamp>2012-09-11T15:19:05.457</ChangeStamp> <ChangedByUser>sample</ChangedByUser> <CreateStamp>2012-09-11T15:04:02.833</CreateStamp> <CreatedByUser>sample</CreatedByUser> <Email>info@swiftreach.com</Email> <EntityGuid>736c8340-e23b-4c23-aaa1-f55cfdb391bb</EntityGuid> <EntityName>Bob</EntityName> <Fax> </Fax> <Pager></Pager> <PagerNetwork>0</PagerNetwork> <Phones> <PhoneProfile> <AnsDetectionOverride>UseDefault</AnsDetectionOverride> <Extension></Extension> <OptInSMS>true</OptInSMS> <Phone>2012361344</Phone> <PhoneLabel>Mobile</PhoneLabel> <PhoneType>phonetype_voice</PhoneType> </PhoneProfile> </Phones> <PinCode></PinCode> <SMSNetwork>0</SMSNetwork> <SMSPhone></SMSPhone> <SpokenLanguage>English</SpokenLanguage> <Tag></Tag> <UserDefined /> </Contact> </ArrayOfContact>
-
List Contacts
Description: Returns an array of Contacts for the given Contact list.Usage:
GET api/ContactLists/Contacts/List/{ListCode}/{RowIndex}/{PageSize}/{SortField}/{SortDir}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list RowIndex Int32 FromUri the starting row index for the page to get records from. The first row starts with 0. PageSize Int32 FromUri the total number of records to return in a page SortField String FromUri The direction to sort the results Value Description EntityName The name of the contact entity EntityGuid Guid that uniquely identifies the contact Phone The phone number of the entity Email The email address of the entity Address The street address of the entity City The city of the entity StateProv The state or provence of the entity PostalCode The postal code of the contact entity SortDir String FromUri The direction to sort the results Value Description ASC Sort in ascending order DESC Sort in descending order Returns:
Array of Contact objects
Examples:
<!-- Intent: gets the list of contacts in the contact list with ListCode 123456 sorted by Phone. This will return the first 5 rows. GET to the following url http://api.v4.swiftreach.com/api/ContactLists/Contacts/List/123456/1/5/Phone/DESC --> <!-- No XML input is required --> <!-- example return value --> <ArrayOfContact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SwiftReach.Swift911.Core.ContactLists"> <Contact> <Addresses> <AddressProfile> <Address1>14 Industrial Ave</Address1> <Address2></Address2> <AddressGuid>22748f25-07b8-459c-bcef-ce2ba851a84c</AddressGuid> <City>Mahwah</City> <County></County> <IsPrimary>false</IsPrimary> <Label>Office</Label> <Latitude>41.052698269486427</Latitude> <Longitude>-74.121656566858292</Longitude> <PostalCode>07430</PostalCode> <State>NJ</State> </AddressProfile> </Addresses> <ChangeStamp>2012-09-11T15:19:05.457</ChangeStamp> <ChangedByUser>sample</ChangedByUser> <CreateStamp>2012-09-11T15:04:02.833</CreateStamp> <CreatedByUser>sample</CreatedByUser> <Email>info@swiftreach.com</Email> <EntityGuid>736c8340-e23b-4c23-aaa1-f55cfdb391bb</EntityGuid> <EntityName>Bob</EntityName> <Fax> </Fax> <Pager></Pager> <PagerNetwork>0</PagerNetwork> <Phones> <PhoneProfile> <AnsDetectionOverride>UseDefault</AnsDetectionOverride> <Extension></Extension> <OptInSMS>true</OptInSMS> <Phone>2012361344</Phone> <PhoneLabel>Mobile</PhoneLabel> <PhoneType>phonetype_voice</PhoneType> </PhoneProfile> </Phones> <PinCode></PinCode> <SMSNetwork>0</SMSNetwork> <SMSPhone></SMSPhone> <SpokenLanguage>English</SpokenLanguage> <Tag></Tag> <UserDefined /> </Contact> </ArrayOfContact>
-
Search for a Contact on a List
Description: Searches the given contact list and returns an array of ContactsUsage:
GET api/ContactLists/Contacts/Search/{ListCode}/{RowIndex}/{PageSize}/{SortField}/{SortDir}/{SearchField}/{SearchCriteria}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list RowIndex Int32 FromUri the starting row index for the page to get records from. The first row starts with 0. PageSize Int32 FromUri the total number of records to return in a page SortField String FromUri The direction to sort the results Value Description EntityName The name of the contact entity EntityGuid Guid that uniquely identifies the contact Phone The phone number of the entity Email The email address of the entity Address The street address of the entity City The city of the entity StateProv The state or provence of the entity PostalCode The postal code of the contact entity SortDir String FromUri The direction to sort the results Value Description ASC Sort in ascending order DESC Sort in descending order SearchField String FromUri The direction to sort the results Value Description EntityName The name of the contact entity EntityGuid Guid that uniquely identifies the contact Phone The phone number of the entity Email The email address of the entity Address The street address of the entity City The city of the entity StateProv The state or provence of the entity PostalCode The postal code of the contact entity SearchCriteria String FromUri The value to search for in the given field Returns:
Array of Contact objects
Examples:
<!-- Intent: gets the list of contacts in the contact list with ListCode 123456 sorted by Phone where the EntityName is like Bob. This will return the first 5 rows. GET to the following url http://api.v4.swiftreach.com/api/ContactLists/Contacts/Search/123456/1/5/Phone/DESC/EntityName/Bob --> <!-- No XML input is required --> <!-- example return value --> <ArrayOfContact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SwiftReach.Swift911.Core.ContactLists"> <Contact> <Addresses> <AddressProfile> <Address1>14 Industrial Ave</Address1> <Address2></Address2> <AddressGuid>22748f25-07b8-459c-bcef-ce2ba851a84c</AddressGuid> <City>Mahwah</City> <County></County> <IsPrimary>false</IsPrimary> <Label>Office</Label> <Latitude>41.052698269486427</Latitude> <Longitude>-74.121656566858292</Longitude> <PostalCode>07430</PostalCode> <State>NJ</State> </AddressProfile> </Addresses> <ChangeStamp>2012-09-11T15:19:05.457</ChangeStamp> <ChangedByUser>sample</ChangedByUser> <CreateStamp>2012-09-11T15:04:02.833</CreateStamp> <CreatedByUser>sample</CreatedByUser> <Email>info@swiftreach.com</Email> <EntityGuid>736c8340-e23b-4c23-aaa1-f55cfdb391bb</EntityGuid> <EntityName>Bob</EntityName> <Fax> </Fax> <Pager></Pager> <PagerNetwork>0</PagerNetwork> <Phones> <PhoneProfile> <AnsDetectionOverride>UseDefault</AnsDetectionOverride> <Extension></Extension> <OptInSMS>true</OptInSMS> <Phone>2012361344</Phone> <PhoneLabel>Mobile</PhoneLabel> <PhoneType>phonetype_voice</PhoneType> </PhoneProfile> </Phones> <PinCode></PinCode> <SMSNetwork>0</SMSNetwork> <SMSPhone></SMSPhone> <SpokenLanguage>English</SpokenLanguage> <Tag></Tag> <UserDefined /> </Contact> </ArrayOfContact>
-
Get Count of Contacts in List
Description: Returns the total number of contacts in the given contact listUsage:
GET api/ContactLists/Contacts/Count/{ListCode}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list Returns:
Examples:
<!-- Intent: gets the total number of contacts in the contact list with ListCode 123456. GET to the following url http://api.v4.swiftreach.com/api/ContactLists/Contacts/Count/123456 --> <!-- No XML input is required --> <!-- example return value --> <int>1</int>
-
Get Count of Search Results
Description: Returns the total number of contacts from the search results.Usage:
GET api/ContactLists/Contacts/Search/Count/{ListCode}/{SearchField}/{SearchCriteria}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list SearchField String FromUri The direction to sort the results Value Description EntityName The name of the contact entity EntityGuid Guid that uniquely identifies the contact Phone The phone number of the entity Email The email address of the entity Address The street address of the entity City The city of the entity StateProv The state or provence of the entity PostalCode The postal code of the contact entity SearchCriteria String FromUri The value to search for in the given field Returns:
Examples:
<!-- Intent: gets the total number of contacts in the contact list with ListCode 123456 where the EntityName is like Bob. GET to the following url http://api.v4.swiftreach.com/api/ContactLists/Contacts/Search/Count/123456/EntityName/Bob --> <!-- No XML input is required --> <!-- example return value --> <int>1</int>
-
Verify Contact Exists
Description: Verifies that the given Contact exists on the given contact listUsage:
GET api/ContactLists/Contacts/Exists/{ListCode}/{EntityGuid}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list EntityGuid String FromUri Guid that uniquely identifies the Contact Returns:
True if the contact exists
Examples:
<!-- Intent: verifies a contact with the given EntityGuid exists on list with listcode of 123456 GET to the following url http://api.v4.swiftreach.com/api/ContactLists/Contacts/Exists/123456/736c8340-e23b-4c23-aaa1-f55cfdb391bb --> <!-- No XML input is required --> <!-- example return value --> <int>true</int>
-
Create New Contact
Description: Creates a new Contact on the given contact listUsage:
POST api/ContactLists/Contacts/Create/{ListCode}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list ContactProfile Contact FromBody The Contact profile to create Returns:
Returns the Guid that uniquely identifies the new contact
Examples:
<!-- Intent: add a new contact to a contact list with listcode of 123456 POST to the following url http://api.v4.swiftreach.com/api/ContactLists/Contacts/Create/123456 --> <!-- POSTED data --> <Contact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema/SwiftReach.Swift911.Core.ContactLists"> <Addresses> <AddressProfile> <Address1>14 Industrial Ave</Address1> <Address2></Address2> <AddressGuid>22748f25-07b8-459c-bcef-ce2ba851a84c</AddressGuid> <City>Mahwah</City> <County></County> <IsPrimary>false</IsPrimary> <Label>Office</Label> <Latitude>41.052698269486427</Latitude> <Longitude>-74.121656566858292</Longitude> <PostalCode>07430</PostalCode> <State>NJ</State> </AddressProfile> </Addresses> <Email>info@swiftreach.com</Email> <EntityGuid>736c8340-e23b-4c23-aaa1-f55cfdb391bb</EntityGuid> <EntityName>Bob</EntityName> <Fax> </Fax> <Pager></Pager> <PagerNetwork>0</PagerNetwork> <Phones> <PhoneProfile> <AnsDetectionOverride>UseDefault</AnsDetectionOverride> <Extension></Extension> <OptInSMS>true</OptInSMS> <Phone>2012361344</Phone> <PhoneLabel>Mobile</PhoneLabel> <PhoneType>phonetype_voice</PhoneType> </PhoneProfile> </Phones> <PinCode></PinCode> <SMSNetwork>0</SMSNetwork> <SMSPhone></SMSPhone> <SpokenLanguage>English</SpokenLanguage> <Tag></Tag> <UserDefined /> </Contact> <!-- example return value --> <string>22748f25-07b8-459c-bcef-ce2ba851a84c</string>
-
Create New Contacts From GZipped Array
Description: Creates new Contacts on the given contact list. This method is limited to arrays of 2000 contacts or less. The gzip compressed contacts array xml should be sent in the HTTP POST body using a content-type of application x-www-form-urlencoded.Usage:
POST api/ContactLists/Contacts/Create/Compressed/{ListCode}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list Returns:
Returns an array of Guids that uniquely identifies each new contact. An empty Guid will be returned for any contact was not successfully created.
Examples:
//-- Currently no examples for XML --//
-
Create New Contacts From Array
Description: Creates new Contacts on the given contact list. This method is limited to arrays of 2000 contacts or less.Usage:
POST api/ContactLists/Contacts/CreateFromArray/{ListCode}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list ContactProfile Contact[] FromBody Array of Contact profiles to create Returns:
Returns an array of Guids that uniquely identifies each new contact. An empty Guid will be returned for any contact was not successfully created.
Examples:
<!-- Intent: add an array of new contacts to a contact list with listcode of 123456 POST to the following url http://api.v4.swiftreach.com/api/ContactLists/Contacts/CreateFromArray/123456 --> <!-- POSTED data --> <ArrayOfContact> <Contact> <Addresses> <AddressProfile> <Address1>14 Industrial Ave</Address1> <Address2></Address2> <AddressGuid>22748f25-07b8-459c-bcef-ce2ba851a84c</AddressGuid> <City>Mahwah</City> <County></County> <IsPrimary>false</IsPrimary> <Label>Office</Label> <Latitude>41.052698269486427</Latitude> <Longitude>-74.121656566858292</Longitude> <PostalCode>07430</PostalCode> <State>NJ</State> </AddressProfile> </Addresses> <Email>info@swiftreach.com</Email> <EntityGuid>b7bf6e7d-cdfe-48d8-b540-b9056ad21925</EntityGuid> <EntityName>Bob</EntityName> <Fax> </Fax> <Pager></Pager> <PagerNetwork>0</PagerNetwork> <Phones> <PhoneProfile> <AnsDetectionOverride>UseDefault</AnsDetectionOverride> <Extension></Extension> <OptInSMS>true</OptInSMS> <Phone>2012361344</Phone> <PhoneLabel>Mobile</PhoneLabel> <PhoneType>phonetype_voice</PhoneType> </PhoneProfile> </Phones> <PinCode></PinCode> <SMSNetwork>0</SMSNetwork> <SMSPhone></SMSPhone> <SpokenLanguage>English</SpokenLanguage> <Tag></Tag> <UserDefined /> </Contact> <Contact> <Addresses> <AddressProfile> <Address1>31 Industrial Ave</Address1> <Address2></Address2> <AddressGuid>9479f48b-0dfc-4130-9387-165d3d7a8ef3</AddressGuid> <City>Mahwah</City> <County></County> <IsPrimary>false</IsPrimary> <Label>Office</Label> <Latitude>41.052698269486427</Latitude> <Longitude>-74.121656566858292</Longitude> <PostalCode>07430</PostalCode> <State>NJ</State> </AddressProfile> </Addresses> <Email>info@swiftreach.com</Email> <EntityGuid>b7bf6e7d-cdfe-48d8-b540-b9056ad21925</EntityGuid> <EntityName>Frank</EntityName> <Fax> </Fax> <Pager></Pager> <PagerNetwork>0</PagerNetwork> <Phones> <PhoneProfile> <AnsDetectionOverride>UseDefault</AnsDetectionOverride> <Extension></Extension> <OptInSMS>true</OptInSMS> <Phone>2012368625</Phone> <PhoneLabel>Mobile</PhoneLabel> <PhoneType>phonetype_voice</PhoneType> </PhoneProfile> </Phones> <PinCode></PinCode> <SMSNetwork>0</SMSNetwork> <SMSPhone></SMSPhone> <SpokenLanguage>English</SpokenLanguage> <Tag></Tag> <UserDefined /> </Contact> </ArrayOfContact> <!-- example return value --> <ArrayOfstring xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <string>de4b9815-e0d1-4d53-94cd-3d3b43a0febd</string> <string>b7bf6e7d-cdfe-48d8-b540-b9056ad21925</string> </ArrayOfstring>
-
Update Contact
Description: Updates the contact information for the given contactUsage:
PUT api/ContactLists/Contacts/Update/{ListCode}/{EntityGuid}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list EntityGuid String FromUri Guid that uniquely identifies the Contact ContactProfile Contact FromBody The Contact profile to update Returns:
0 on success
Examples:
<!-- Intent: updates the given contact on the contact list with listcode of 123456 PUT to the following url http://api.v4.swiftreach.com/api/ContactLists/Contacts/Update/123456/736c8340-e23b-4c23-aaa1-f55cfdb391bb --> <!-- POSTED data --> <Contact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema/SwiftReach.Swift911.Core.ContactLists"> <Addresses> <AddressProfile> <Address1>14 Industrial Ave</Address1> <Address2></Address2> <AddressGuid>22748f25-07b8-459c-bcef-ce2ba851a84c</AddressGuid> <City>Mahwah</City> <County></County> <IsPrimary>false</IsPrimary> <Label>Office</Label> <Latitude>41.052698269486427</Latitude> <Longitude>-74.121656566858292</Longitude> <PostalCode>07430</PostalCode> <State>NJ</State> </AddressProfile> </Addresses> <Email>info@swiftreach.com</Email> <EntityGuid>736c8340-e23b-4c23-aaa1-f55cfdb391bb</EntityGuid> <EntityName>Bob</EntityName> <Fax> </Fax> <Pager></Pager> <PagerNetwork>0</PagerNetwork> <Phones> <PhoneProfile> <AnsDetectionOverride>UseDefault</AnsDetectionOverride> <Extension></Extension> <OptInSMS>true</OptInSMS> <Phone>2012361344</Phone> <PhoneLabel>Mobile</PhoneLabel> <PhoneType>phonetype_voice</PhoneType> </PhoneProfile> </Phones> <PinCode></PinCode> <SMSNetwork>0</SMSNetwork> <SMSPhone></SMSPhone> <SpokenLanguage>English</SpokenLanguage> <Tag></Tag> <UserDefined /> </Contact> <!-- example return value --> <int>0</int>
-
Delete Contact
Description: Deletes the given contact from the given contact listUsage:
DELETE api/ContactLists/Contacts/Delete/{ListCode}/{EntityGuid}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list EntityGuid String FromUri Guid that uniquely identifies the Contact Returns:
0 on success
Examples:
<!-- Intent: delete the contact with the specified entityguid from the specified contact list DELETE to the following url http://api.v4.swiftreach.com/api/ContactLists/Contacts/Delete/123456/4BA46DF4-6FF7-4AEF-B214-3BCC332AB5F4 --> <!-- No XML input is required --> <!-- example return value --> <int>0</int>
-
Assign Contact
Description: Assigns an existing contact to an additional contact listUsage:
POST api/ContactLists/Contacts/Assign/{MasterListCode}/{ListCode}/{EntityGuid}
Parameter Type Source Description MasterListCode Int32 FromUri A numerical list code identifying an existing list which this contact is already a member of ListCode Int32 FromUri The numerical list code identifying the contact list to assign this contact to. EntityGuid String FromUri Guid that uniquely identifies the Contact Returns:
0 on success
Examples:
//-- Currently no examples for XML --//
-
Get Profile for Contact
Description: Returns the contact profile for the given entityUsage:
GET api/ContactLists/Contacts/{ListCode}/{EntityGuid}
Parameter Type Source Description ListCode Int32 FromUri Unique numerical code that identifies the contact list EntityGuid String FromUri Guid that uniquely identifies the Contact Returns:
Contact object
Examples:
<!-- Intent: gets contact profile for the given EntityGuid belonging to the given listcode of 123456. GET to the following url http://api.v4.swiftreach.com/api/ContactLists/Contacts/123456/4BA46DF4-6FF7-4AEF-B214-3BCC332AB5F4" --> <!-- No XML input is required --> <!-- example return value --> <Contact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SwiftReach.Swift911.Core.ContactLists"> <Addresses> <AddressProfile> <Address1>14 Industrial Ave</Address1> <Address2></Address2> <AddressGuid>22748f25-07b8-459c-bcef-ce2ba851a84c</AddressGuid> <City>Mahwah</City> <County></County> <IsPrimary>false</IsPrimary> <Label>Office</Label> <Latitude>41.052698269486427</Latitude> <Longitude>-74.121656566858292</Longitude> <PostalCode>07430</PostalCode> <State>NJ</State> </AddressProfile> </Addresses> <ChangeStamp>2012-09-11T15:19:05.457</ChangeStamp> <ChangedByUser>sample</ChangedByUser> <CreateStamp>2012-09-11T15:04:02.833</CreateStamp> <CreatedByUser>sample</CreatedByUser> <Email>info@swiftreach.com</Email> <EntityGuid>736c8340-e23b-4c23-aaa1-f55cfdb391bb</EntityGuid> <EntityName>Bob</EntityName> <Fax> </Fax> <Pager></Pager> <PagerNetwork>0</PagerNetwork> <Phones> <PhoneProfile> <AnsDetectionOverride>UseDefault</AnsDetectionOverride> <Extension></Extension> <OptInSMS>true</OptInSMS> <Phone>2012361344</Phone> <PhoneLabel>Mobile</PhoneLabel> <PhoneType>phonetype_voice</PhoneType> </PhoneProfile> </Phones> <PinCode></PinCode> <SMSNetwork>0</SMSNetwork> <SMSPhone></SMSPhone> <SpokenLanguage>English</SpokenLanguage> <Tag></Tag> <UserDefined /> </Contact>