...
...
The following operations allow you to work with contacts. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with contacts, see Sample configuration.
Operation details
This section provides further details on the operations related to contacts.
Anchor |
---|
| createContact |
---|
| createContact |
---|
|
Creating a new contactThe createContact
operation creates a new contact.
Code Block |
---|
language | xml |
---|
title | createContact |
---|
|
<freeagent.createContact>
<organisationName>{$ctx:organisationName}</organisationName>
<firstName>{$ctx:firstName}</firstName>
<lastName>{$ctx:lastName}</lastName>
<email>{$ctx:email}</email>
<phoneNumber>{$ctx:phoneNumber}</phoneNumber>
<address1>{$ctx:address1}</address1>
<town>{$ctx:town}</town>
<region>{$ctx:region}</region>
<postcode>{$ctx:postcode}</postcode>
<address2>{$ctx:address2}</address2>
<address3>{$ctx:address3}</address3>
<contactNameOnInvoices>{$ctx:contactNameOnInvoices}</contactNameOnInvoices>
<country>{$ctx:country}</country>
<salesTaxRegistrationNumber>{$ctx:salesTaxRegistrationNumber}</salesTaxRegistrationNumber>
<usesContactInvoiceSequence>{$ctx:usesContactInvoiceSequence}</usesContactInvoiceSequence>
</freeagent.createContact> |
organisationName:
The name of the organization.firstName:
The first name of the contact.lastName:
The last name of the contact.email:
The e-mail address of the contact.phoneNumber:
The telephone number of the contact.address1:
The first address line of the contact.town:
The town of the contact.region:
The region of the contact.postcode:
The post code of the contact.address2:
The second address line of the contact.address3:
The third address line of the contact.contactNameOnInvoices:
The Boolean flag to indicate whether the contact name should be displayed in invoices.country:
The country of the contact.salesTaxRegistrationNumber:
The sales tax registration number of the contact.usesContactInvoiceSequence:
The Boolean flag to indicate use of the contact invoice sequence.
Sample requestFollowing is a sample REST/JSON request that can be handled by the createContact operation.
Code Block |
---|
language | xml |
---|
title | Sample Request for createContact |
---|
|
{
"apiUrl" : "https://api.sandbox.freeagent.com",
"accessToken" : "1YBpWH_SDwDUalF5Vv541uiW3zBIkjccmh817gRnV",
"organisationName" : "Virtusa",
"firstName" : "John",
"lastName" : "Carter",
"email" : "john.carter@gmail.com",
"phoneNumber" : "98869558",
"address1" : "234",
"town" : "Colombo",
"region" : "Western",
"postcode" : "112233",
"address2" : "Silva Avenue",
"address3" : "Dematagoda",
"contactNameOnInvoices" : "false",
"country" : "Sri Lanka",
"salesTaxRegistrationNumber" : "1311",
"usesContactInvoiceSequence" : "true"
} |
https://dev.freeagent.com/docs/contacts#create-a-contact
Anchor |
---|
| getContactById |
---|
| getContactById |
---|
|
Retrieving a single contact by IDThe getContactById
operation retrieves a single contact by ID.
Code Block |
---|
language | xml |
---|
title | getContactById |
---|
|
<freeagent.getContactById>
<id>{$ctx:id}</id>
</freeagent.getContactById> |
id:
The ID of the contact.
Following is a sample REST/JSON request that can be handled by the getContactById
operation.
Code Block |
---|
language | xml |
---|
title | getContactById |
---|
|
{
"apiUrl" : "https://api.sandbox.freeagent.com",
"accessToken" : "1YBpWH_SDwDUalF5Vv541uiW3zBIkjccmh817gRnV",
"id" : "28437"
} |
https://dev.freeagent.com/docs/contacts#get-a-single-contact
Retrieving all contactsThe listContacts
operation retrieves all contacts.
Code Block |
---|
language | xml |
---|
title | listContacts |
---|
|
<freeagent.listContacts>
<view>{$ctx:view}</view>
<sort>{$ctx:sort}</sort>
</freeagent.listContacts> |
view:
The value for view filter.sort:
The value for sort order.
Following is a sample REST/JSON request that can be handled by the listContacts
operation.
Code Block |
---|
language | xml |
---|
title | listContacts |
---|
|
{
"apiUrl" : "https://api.sandbox.freeagent.com",
"accessToken" : "1YBpWH_SDwDUalF5Vv541uiW3zBIkjccmh817gRnV",
"view" : "all",
"sort" : "name"
} |
https://dev.freeagent.com/docs/contacts#list-all-contacts
Anchor |
---|
| sampleconfiguration |
---|
| sampleconfiguration |
---|
|
Sample configurationFollowing is a sample proxy service that illustrates how to connect to FreeAgent with the init
operation and use the createContact operation. The sample request for this proxy can be found in the createContact sample request. You can use this sample as a template for using other operations in this category.
...