Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
maxLevel3
typeflat

...

Overview

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

OperationDescription

1Working with Contacts in FreeAgentcreateContact

Creates a new contact.

1Working with Contacts in FreeAgentgetContactByIdRetrieves a single contact by ID.
1Working with Contacts in FreeAgentlistContactsRetrieves all contacts.

Operation details

This section provides further details on the operations related to contacts.

Anchor
createContact
createContact
Creating a new contact

The createContact operation creates a new contact.

Code Block
languagexml
titlecreateContact
<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>
Properties
  • 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.
Anchor
request
request
Sample request

Following is a sample REST/JSON request that can be handled by the createContact operation.

Code Block
languagexml
titleSample 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"
}
Related FreeAgent documentation

https://dev.freeagent.com/docs/contacts#create-a-contact

Anchor
getContactById
getContactById
Retrieving a single contact by ID

The getContactById operation retrieves a single contact by ID.

Code Block
languagexml
titlegetContactById
<freeagent.getContactById>
	<id>{$ctx:id}</id>
</freeagent.getContactById>
Properties
  • id: The ID of the contact.
Sample request

Following is a sample REST/JSON request that can be handled by the getContactById operation.

Code Block
languagexml
titlegetContactById
{
	"apiUrl" : "https://api.sandbox.freeagent.com",
	"accessToken" : "1YBpWH_SDwDUalF5Vv541uiW3zBIkjccmh817gRnV",
	"id" : "28437"
}
Related FreeAgent documentation

https://dev.freeagent.com/docs/contacts#get-a-single-contact

Anchor
listContacts
listContacts
Retrieving all contacts

The listContacts operation retrieves all contacts.

Code Block
languagexml
titlelistContacts
<freeagent.listContacts>
	<view>{$ctx:view}</view>
    <sort>{$ctx:sort}</sort>
</freeagent.listContacts>
Properties
  • view: The value for view filter.
  • sort: The value for sort order.
Sample request

Following is a sample REST/JSON request that can be handled by the listContacts operation.

Code Block
languagexml
titlelistContacts
{
	"apiUrl" : "https://api.sandbox.freeagent.com",
	"accessToken" : "1YBpWH_SDwDUalF5Vv541uiW3zBIkjccmh817gRnV",
	"view" : "all",
	"sort" : "name"
}
Related FreeAgent documentation

https://dev.freeagent.com/docs/contacts#list-all-contacts

Anchor
sampleconfiguration
sampleconfiguration
Sample configuration

Following 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. 

...