Notes REST API

Working with a single note

MethodResult
URIhttps://[CompanyID].crittah.com/ws/apiv2/[json or xml]/notes/[idnote]
DELETE

Delete note.

URI for updating a note:

https://[CompanyID].crittah.com/ws/apiv2/[json or xml]/notes/[idnote]

GETReturns data for one note
POST

Update one note; returns note data after request

URI for updating a note:

https://[CompanyID].crittah.com/ws/apiv2/[json or xml]/notes/[idnote]

PUT

Create a note for a specific entity type

URI for adding a note:

https://[CompanyID].crittah.com/ws/apiv2/[json or xml]/notes/[EntityType]

Data fields

FieldValue type DescriptionExample
IDNotestring Unique identifier of the note7090fad1-c4da-4488-9ceb-55ee9847edcc
IDEntitystringYESUnique identifier of the entity (contact, customer job ID etc).7090fad1-c4da-4488-9ceb-55ee9847edcc
IDNoteTypestringYESID of the note type (see Helper REST API to get types)7090fad1-c4da-4488-9ceb-55ee9847edcc
Typestring Note TypeImportant
NoteInfostringYESSite Name that contact belongs toHello this is some text of a note
EntityTypestring 

The entity that the note should be attached to. This must be used when adding a note. Acceptable Entity types are:-

  • CUSTOMER

  • CONTACT

  • JOB

  • JOBTEMPLATE

  • DRIVER

JOB

Examples

Get a note details

Sample cURL call:

curl -H "Accept: application/json"  \
-H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://localhost:6325/ws/apiv2/json/notes/6df67939-97b1-4724-a966-77fa0b7438f9

JSON Rsponse:

 {
      "IDNote": "6df67939-97b1-4724-a966-77fa0b7438f9",
      "IDEntity": "7090fad1-c4da-4488-9ceb-55ee9847edcc",
      "IDNoteType": "2b11efc3-2a43-4c03-92ac-923e77f821a2",
      "Type": "Important",
      "NoteInfo": "Maincontact for organisation"
 }

XML Response: 

<?xml version="1.0" encoding="UTF-8"?>
<NoteObj xmlns="http://schemas.datacontract.org/2004/07/Spinifex.lib.objects" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

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

Add a note

Sample cURL call:

curl -X PUT
-H "Accept: application/json"  \
-H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://localhost:6325/ws/apiv2/json/notes/JOB

JSON Rsponse:

 {
      "IDEntity": "7090fad1-c4da-4488-9ceb-55ee9847edcc",
      "IDNoteType": "2b11efc3-2a43-4c03-92ac-923e77f821a2",
      "NoteInfo": "Testing create new job note"
 }

 

Update a note

Sample cURL call:

curl -X POST
-H "Accept: application/json"  \
-H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://localhost:6325/ws/apiv2/json/notes/7090fad1-c4da-4488-9ceb-55ee9847edcc

JSON Rsponse:

 {
      "IDNoteType": "2b11efc3-2a43-4c03-92ac-923e77f821a2",
      "NoteInfo": "Testing update of note"
 }

Delete a note

Sample cURL call:

curl -X DELETE
-H "Accept: application/json"  \
-H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://localhost:6325/ws/apiv2/json/notes/7090fad1-c4da-4488-9ceb-55ee9847edcc

JSON Rsponse:

{
  "Extra": "",
  "Message": "",
  "Success": false
}