Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Working with a single contact

MethodResult
URIhttps://[CompanyID].crittah.com/ws/apiv2/[json or xml]/contacts/[contactId]
DELETEDeletes one contact
GETReturns data for one contact
POSTCreate or modify only the supplied data for one contact; returns contact data after request
PUTNot supported

Data fields

FieldValue typeMandatoryDescriptionExample
IDContactstring Unique identifier of the contact. You can omit this field when creating a new contact. The ContactID is used for updating or deleting an existing contact.7090fad1-c4da-4488-9ceb-55ee9847edcc
ExternalRefstring A reference to an id used in an external system to Crittah. This can be used to link Crittah to internal systems and maintaining the relationship between the two systems.HSG29373
ContactRefstring Human readable unique identifier of the contact2586681
IDSitestringYESUnique ID for the site the contact belongs to20058233-7388-418b-9193-6b57e28604f9
Sitestring Site Name that contact belongs toSYD
TypesTypes Object Array of types returned when getting a record

[ { "IDType": "c0fd94f3-2ddd-4eea-bc24-40189480d10f",

"Type": "Producer" },
{ "IDType": "eb6bef8f-6f03-49dd-80a4-83a220f6ddc3",
"Type": "VIP" } ]

IDTypesArray strings Used when adding or updating the record"IDTypes": [ "c0fd94f3-2ddd-4eea-bc24-40189480d10f", "eb6bef8f-6f03-49dd-80a4-83a220f6ddc3"]
Salutationstring Salutation of the contactMr
FirstNamestringYESContact’s first name.John
LastNamestring Contact’s last name.Smith
Emailstring Contacts Email addressj.peterson@gmal.com
Phonestring Contacts phone(02) 9506 3560
Mobilestring Contacts Mobile0412 544 654
Faxstring Contacts Fax(02) 9567 680
BirthDatestring contacts birth date in ISO 8601 format 2010-08-20T15:00:00Z
Positionstring Contacts positionManager
Departmentstring Contacts departmentBeverage
IDStatusstring IDStatus of contact926a4185-6cb3-4a2a-a8ec-1fadc1cf4caa
Statusstring Status of ContactActive
CustomerCustomer Object Customer that the contact belongs toSee Customer Object 
AddressAddress Object Contacts AddressSee Address Object
NotesArray of Notes Object Contact notes.See Notes Object

Examples

Get a contacts details

Sample cURL call:

curl -H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://[CompanyID].crittah.com/ws/apiv2/json/contacts/7090fad1-c4da-4488-9ceb-55ee9847edcc

JSON Rsponse:

 {
  "IDContact": "7090fad1-c4da-4488-9ceb-55ee9847edcc",
  "ContactRef": "2586681",
  "IDSite": "20058233-7388-418b-9193-6b57e28604f9",
  "Site": "SYD",
  "Types": [
    {
      "IDType": "c0fd94f3-2ddd-4eea-bc24-40189480d10f",
      "Type": "Producer"
    },
    {
      "IDType": "eb6bef8f-6f03-49dd-80a4-83a220f6ddc3",
      "Type": "VIP"
    }
  ],
  "Salutation": "Mr",
  "FirstName": "John",
  "LastName": "Peterson",
  "Email": "j.peterson@gmal.com",
  "Phone": "(02) 9506 3560",
  "Mobile": "0412 544 654",
  "Fax": "9567 680",
  "BirthDate": "1978-04-01T00:00:00Z",
  "Position": "Manager",
  "Department": "Beverage",
  "IDStatus": "926a4185-6cb3-4a2a-a8ec-1fadc1cf4caa",
  "Status": "Active",
  "Customer": {
    "AccountOwner": "00000000-0000-0000-0000-000000000000",
    "Address": {
      "IDAddress": "2d69c03b-5b57-46b4-8d67-43d2f27d225a",
      "AddressLine1": "88 Castlereagh Street",
      "AddressLine2": null,
      "City": "SYDNEY",
      "State": "NSW",
      "IDCountry": 1013,
      "Country": "Australia",
      "PostCode": "2000",
      "LocRef": {
        "IDLocation": "e97c85a5-62c0-4e13-bb63-ed8a43050360",
        "LatLng": {
          "Lat": -33.869738,
          "Lng": 151.209448
        }
      }
    },
    "AddressBilling": {
      "IDAddress": "368321fe-de7e-4f38-80a7-e7ea8e34fe26",
      "AddressLine1": "88 Castlereagh Street",
      "AddressLine2": null,
      "City": "SYDNEY",
      "State": "NSW",
      "IDCountry": 1013,
      "Country": "Australia",
      "PostCode": "2000",
      "LocRef": {
        "IDLocation": "6db14940-f906-4c20-949a-e332f6798336",
        "LatLng": {
          "Lat": -33.869738,
          "Lng": 151.209448
        }
      }
    },
    "CompanyName": "Sydney Bunting Supplies",
    "CompanyNo": "654 654 9879",
    "Council": "Sydney",
    "CustomerRef": "7193032",
    "Fax": "654 654 544",
    "IDCustomer": "5f3f2135-d0f5-47a4-906e-7274b0128054",
    "IDSite": "20058233-7388-418b-9193-6b57e28604f9",
    "IDStatus": "926a4185-6cb3-4a2a-a8ec-1fadc1cf4caa",
    "Mobile": "0414 656 654",
    "Notes": [
      {
        "IDEntity": "5f3f2135-d0f5-47a4-906e-7274b0128054",
        "IDNoteType": "77d5d244-eb29-4b5b-8b14-87d92b4215ea",
        "Type": "General",
        "NoteInfo": "Contact the front desk for assistance",
        "IDNote": "05629a9b-2869-4197-82af-b6f975be93c8"
      },
      {
        "IDEntity": "5f3f2135-d0f5-47a4-906e-7274b0128054",
        "IDNoteType": "77d5d244-eb29-4b5b-8b14-87d92b4215ea",
        "Type": "General",
        "NoteInfo": "Entry is via 120 King st - last driveway on right before Castlereagh st.",
        "IDNote": "cf67b514-3ba2-44d9-82f0-c0d5f8d57816"
      }
    ],
    "Parent": null,
    "Phone": "9575 545",
    "Site": "SYD",
    "Status": "Active",
    "Types": [
      {
        "IDType": "4d819963-731c-41fd-9378-fd7a10199b78",
        "Type": "Associates"
      },
      {
        "IDType": "21a952eb-089e-467a-98bf-f8cb9a0ebd88",
        "Type": "Producer"
      }
    ],
    "WebSite": "http:\/\/www.buntingsupplies.comau"
  },
  "Address": {
    "IDAddress": "09ad445a-6958-4365-aa4b-1a297828b14d",
    "AddressLine1": "26 Wolongong ROad",
    "AddressLine2": null,
    "City": "ARNCLIFFE",
    "State": "NSW",
    "IDCountry": 1013,
    "Country": "Australia",
    "PostCode": "2205",
    "LocRef": {
      "IDLocation": "328e934c-930f-4610-af3c-edf83c2b9d1a",
      "LatLng": {
        "Lat": -33.934813,
        "Lng": 151.146104
      }
    }
  },
  "Notes": [
    {
      "IDEntity": "7090fad1-c4da-4488-9ceb-55ee9847edcc",
      "IDNoteType": "2b11efc3-2a43-4c03-92ac-923e77f821a2",
      "Type": "Important",
      "NoteInfo": "Maincontact for organisation",
      "IDNote": "6df67939-97b1-4724-a966-77fa0b7438f9"
    }
  ]
}

XML Response: 

<?xml version="1.0" encoding="UTF-8"?>
<ContactObj xmlns="http://schemas.datacontract.org/2004/07/Spinifex.lib.objects" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
   <IDContact>7090fad1-c4da-4488-9ceb-55ee9847edcc</IDContact>
   <ContactRef>2586681</ContactRef>
   <IDSite>20058233-7388-418b-9193-6b57e28604f9</IDSite>
   <Site>SYD</Site>
   <Types>
      <TypeObj>
         <IDType>c0fd94f3-2ddd-4eea-bc24-40189480d10f</IDType>
         <Type>Producer</Type>
      </TypeObj>
      <TypeObj>
         <IDType>eb6bef8f-6f03-49dd-80a4-83a220f6ddc3</IDType>
         <Type>VIP</Type>
      </TypeObj>
   </Types>
   <Salutation>Mr</Salutation>
   <FirstName>John</FirstName>
   <LastName>Peterson</LastName>
   <Email>j.peterson@gmal.com</Email>
   <Phone>(02) 9506 3560</Phone>
   <Mobile>0412 544 654</Mobile>
   <Fax>9567 680</Fax>
   <BirthDate>1978-04-01T00:00:00Z</BirthDate>
   <Position>Manager</Position>
   <Department>Beverage</Department>
   <IDStatus>926a4185-6cb3-4a2a-a8ec-1fadc1cf4caa</IDStatus>
   <Status>Active</Status>
   <Customer>
      <AccountOwner>00000000-0000-0000-0000-000000000000</AccountOwner>
      <Address>
         <IDAddress>2d69c03b-5b57-46b4-8d67-43d2f27d225a</IDAddress>
         <AddressLine1>88 Castlereagh Street</AddressLine1>
         <AddressLine2 i:nil="true" />
         <City>SYDNEY</City>
         <State>NSW</State>
         <IDCountry>1013</IDCountry>
         <Country>Australia</Country>
         <PostCode>2000</PostCode>
         <LocRef>
            <IDLocation>e97c85a5-62c0-4e13-bb63-ed8a43050360</IDLocation>
            <LatLng>
               <Lat>-33.869738</Lat>
               <Lng>151.209448</Lng>
            </LatLng>
         </LocRef>
      </Address>
      <AddressBilling>
         <IDAddress>368321fe-de7e-4f38-80a7-e7ea8e34fe26</IDAddress>
         <AddressLine1>88 Castlereagh Street</AddressLine1>
         <AddressLine2 i:nil="true" />
         <City>SYDNEY</City>
         <State>NSW</State>
         <IDCountry>1013</IDCountry>
         <Country>Australia</Country>
         <PostCode>2000</PostCode>
         <LocRef>
            <IDLocation>6db14940-f906-4c20-949a-e332f6798336</IDLocation>
            <LatLng>
               <Lat>-33.869738</Lat>
               <Lng>151.209448</Lng>
            </LatLng>
         </LocRef>
      </AddressBilling>
      <CompanyName>Sydney Bunting Supplies</CompanyName>
      <CompanyNo>654 654 9879</CompanyNo>
      <Council>Sydney</Council>
      <CustomerRef>7193032</CustomerRef>
      <Fax>654 654 544</Fax>
      <IDCustomer>5f3f2135-d0f5-47a4-906e-7274b0128054</IDCustomer>
      <IDSite>20058233-7388-418b-9193-6b57e28604f9</IDSite>
      <IDStatus>926a4185-6cb3-4a2a-a8ec-1fadc1cf4caa</IDStatus>
      <Mobile>0414 656 654</Mobile>
      <Notes>
         <NoteObj>
            <IDEntity>5f3f2135-d0f5-47a4-906e-7274b0128054</IDEntity>
            <IDNoteType>77d5d244-eb29-4b5b-8b14-87d92b4215ea</IDNoteType>
            <Type>General</Type>
            <NoteInfo>Contact the front desk for assistance</NoteInfo>
            <IDNote>05629a9b-2869-4197-82af-b6f975be93c8</IDNote>
         </NoteObj>
         <NoteObj>
            <IDEntity>5f3f2135-d0f5-47a4-906e-7274b0128054</IDEntity>
            <IDNoteType>77d5d244-eb29-4b5b-8b14-87d92b4215ea</IDNoteType>
            <Type>General</Type>
            <NoteInfo>Entry is via 120 King st - last driveway on right before Castlereagh st.</NoteInfo>
            <IDNote>cf67b514-3ba2-44d9-82f0-c0d5f8d57816</IDNote>
         </NoteObj>
      </Notes>
      <Parent i:nil="true" />
      <Phone>9575 545</Phone>
      <Site>SYD</Site>
      <Status>Active</Status>
      <Types>
         <TypeObj>
            <IDType>4d819963-731c-41fd-9378-fd7a10199b78</IDType>
            <Type>Associates</Type>
         </TypeObj>
         <TypeObj>
            <IDType>21a952eb-089e-467a-98bf-f8cb9a0ebd88</IDType>
            <Type>Producer</Type>
         </TypeObj>
      </Types>
      <WebSite>http://www.buntingsupplies.comau</WebSite>
   </Customer>
   <Address>
      <IDAddress>09ad445a-6958-4365-aa4b-1a297828b14d</IDAddress>
      <AddressLine1>26 Wolongong ROad</AddressLine1>
      <AddressLine2 i:nil="true" />
      <City>ARNCLIFFE</City>
      <State>NSW</State>
      <IDCountry>1013</IDCountry>
      <Country>Australia</Country>
      <PostCode>2205</PostCode>
      <LocRef>
         <IDLocation>328e934c-930f-4610-af3c-edf83c2b9d1a</IDLocation>
         <LatLng>
            <Lat>-33.934813</Lat>
            <Lng>151.146104</Lng>
         </LatLng>
      </LocRef>
   </Address>
   <Notes>
      <NoteObj>
         <IDEntity>7090fad1-c4da-4488-9ceb-55ee9847edcc</IDEntity>
         <IDNoteType>2b11efc3-2a43-4c03-92ac-923e77f821a2</IDNoteType>
         <Type>Important</Type>
         <NoteInfo>Main contact for organisation</NoteInfo>
         <IDNote>6df67939-97b1-4724-a966-77fa0b7438f9</IDNote>
      </NoteObj>
   </Notes>
</ContactObj>

 

Create Contact

Add the follow contents to a file called "contact.data"

{
  "Salutation": "Mr",
  "FirstName": "John",
  "LastName": "Peterson",
  "Email": "j.peterson@gmal.com",
  "Phone": "(02) 9506 3560",
  "Mobile": "0412 544 654",
  "Fax": "9567 680",
  "IDSite": "20058233-7388-418b-9193-6b57e28604f9",
  "IDCustomer": "5f3f2135-d0f5-47a4-906e-7274b0128054",
  "IDStatus":"926a4185-6cb3-4a2a-a8ec-1fadc1cf4caa",
  "Types": [ "c0fd94f3-2ddd-4eea-bc24-40189480d10f","eb6bef8f-6f03-49dd-80a4-83a220f6ddc3"],
  "Address": {
    "AddressLine1": "26 Wolongong ROad",
    "AddressLine2": null,
    "City": "ARNCLIFFE",
    "State": "NSW",
    "IDCountry": 1013,
    "Country": "Australia",
    "PostCode": "2205",
    "LocRef": {
      "IDLocation": "328e934c-930f-4610-af3c-edf83c2b9d1a",
      "LatLng": {
        "Lat": -33.934813,
        "Lng": 151.146104
      }
    }
  },
  "Notes": [
    {
      "IDNoteType": "2b11efc3-2a43-4c03-92ac-923e77f821a2",
      "NoteInfo": "Maincontact for organisation",
    }
  ]
}

Run the following command to create the contact

curl -X POST -d contact.data  \
-H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://YourCompanyID.crittah.com/ws/apiv2/json/contacts

Update Contact

Add the following contents to a file calls "update_contact.data"

{
  "LastName": "XXXXXX",
  "Phone": "(02) 6116 6666",
  "IDTypes": [
    "DFCF3848-1E62-40C1-BED2-6B05FF210304"
  ],
  "Address": {
    "AddressLine1": "26 Wolongong ROad",
    "AddressLine2": null,
    "City": "ARNCLddddE",
    "State": "NSW",
    "IDCountry": 1013,
    "Country": "Australia",
    "PostCode": "2225",
    "LocRef": {
      "IDLocation": "328e934c-930f-4610-af3c-edf83c2b9d1a",
      "LatLng": {
        "Lat": -33.934813,
        "Lng": 151.146104
      }
    }
  }
}

Run the follow cURL command

curl -X POST -d update_contact.data  \
-H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://YourCompanyID.crittah.com/ws/apiv2/json/contacts/[idcontact to update]

 

Delete a contact

curl  -X DELETE \
-H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://YourCompanyID.crittah.com/ws/apiv2/json/contacts/fde3e1d7-5a7c-493d-b49f-dd514fa3b3af

 

 

  • No labels