TeamGram – Webhooks v1

Foreword

You can use TeamGram Webhooks to be notified when a create/update/delete event occurs for records. Whenever a create, update, or delete event occurs within TeamGram we send the record as a JSON to a web end-point you provide.

You can use TeamGram API to create/update/delete records.

Access

You can access and configure webhooks using an administrator account within TeamGram CRM (Control Panel > Webhooks). 

You just need to provide a web end-point that returns success (HTTP 200).

If your end-point is protected you can add a username and password (Basic authentication only) for the webhooks to access the end-point.

Troubleshooting

If your end-point throws an error instead of returning HTTP 200, this interaction is recorded. You can access the failed webhook notifications on the Control Panel > Webhooks > Sending Failed tab. You can see the detailed error message as well as the JSON information.

Please note that excel imports DO NOT trigger webhook notifications.

Webhooks

Webhooks currently supports create/update/delete events for contact, companies, leads, products, opportunities and order.

  • Fields return “null” if empty.
  • Date field format is “yyyy-MM-ddTHH:mm:ss”

Contact Created

  • EventAction: (string) “New”
  • EventEntity: (string) “Individual”
  • Data: (contact object)
    • Id: (int) Unique TeamGram Id for the record.
    • Name: (string) First name.
    • LastName: (string) Last name.
    • CompanyName: (string) Company name of the record.
    • CompanyId: (int) Unique TeamGram Id of the contact’s company.
    • BasicRelationType: (string) Comma separated list of “Customer”,”Vendor”, “Other”, “CompanyContact”, “Prospect”
    • Gender: (“M” or “F”)
    • Position: (string) Title of the contact.
    • Description: (string) Long text description.
    • NotEmployed: (bool) Marked as employed or not (Active/Passive)
    • IdentityNo: (string) Identity number of the person.
    • ContactInfos: (contactinfo object array) Contact information
    • Tags: (string array) Associated tags for the record.
    • Owner: (user object) Owner of the record. 
    • ProfilePictures: (object) Urls of the image associated with the record. (Small/Medium/Large/Original)
    • Regions: (object array) Custom region properties of the record.
      • Id: (int) Unique Region Id
      • Name: (string) Region name
    • RelationshipTypes: (object array) Custom relationship property.
      • Id: (int) Unique Relationship Id
      • Name: (string Relationship type name
    • LastActivityDate: (datetime) UTC Latest activity 
    • ModifiedDate: (datetime) UTC Latest modification 
    • ModifiedByIndividual: (object) Information about the user that modified the record.
    • EnteredDate: (datetime) UTC Creation 
    • EnteredByIndividual: (user object) Information about the user that created the record.
    • CustomFieldDatas: (customfield object array) Custom field values of the record.

Contact Updated

  • EventAction: (string) “Update”
  • EventEntity: (string) “Individual”
  • Data: (contact object)

Contact Deleted

  • EventAction: (string) “Delete”
  • EventEntity: (string) “Individual”
  • Data: (contact object)

Company Created

  • EventAction: (string) “New”
  • EventEntity: (string) “Party”
  • Data: (company object)
    • Id: (int) Unique TeamGram Id for the record.
    • Name: (string) Company name.
    • TradingName: (string) Company trading name.
    • Description: (string) Long text description.
    • BasicRelationType: (string) Comma separated list of “Customer”,”Vendor”, “Other”, “Prospect”
    • ContactInfos: (contact-info object array) Contact information
    • Tags: (string array) Associated tags for the record.
    • Owner: (user object) Owner of the record. 
    • NotAvailable: (bool) Active/Passive switch
    • TaxNo: (string) Tax no
    • TaxOffice: (string) Extra tax info
    • ProfilePictures: (object) Urls of the image associated with the record. (Small/Medium/Large/Original)
    • Regions: (object array) Custom region properties of the record.
      • Id: (int) Unique Region Id
      • Name: (string) Region name
    • RelationshipTypes: (object array) Custom relationship property.
      • Id: (int) Unique Relationship Id
      • Name: (string Relationship type name
    • GeoLocationInfos: (object array) Geo locations for this record.
      • Latitude: Google Maps lat.
      • Longitude: Google Maps lon.
      • Zoom: Google Maps zoom.
      • Indate: (datetime) UTC Location info taken.
    • LastActivityDate: (datetime) UTC Latest activity.
    • ModifiedDate: (datetime) UTC Latest modification.
    • ModifiedByIndividual: (user object) Information about the user that modified the record.
    • EnteredDate: (datetime) UTC Creation datetime (format: yyyy-MM-ddTHH:mm:ss)
    • EnteredByIndividual: (user object) Information about the user that created the record.
    • CustomFieldDatas: (custom-field object array) Custom field values of the record.

Company Updated

  • EventAction: (string) “Update”
  • EventEntity: (string) “Party”
  • Data: (company object)

Company Deleted

  • EventAction: (string) “Delete”
  • EventEntity: (string) “Party”
  • Data: (company object)

Lead Created

  • EventAction: (string) “New”
  • EventEntity: (string) “Lead”
  • Data: (lead object)
    • Id: (int) Unique TeamGram Id for the record.
    • Name: (string) First name.
    • LastName: (string) Last name.
    • CompanyName: (string) Company name of the record.
    • Rating: (int) 0-100. Lead rating
    • Score: (decimal) 0-100. Given score for the lead
    • Position: (string) Title of the contact.
    • Description: (string) Long text description.
    • Converted: (bool) True if the lead is converted to contact/company/opportunity.
    • TaxNo: (string) Tax no
    • TaxOffice: (string) Extra tax info
    • QualifiedBy: (user object) Person qualified this record.
    • QualifiedDate: (datetime) UTC timestamp for qualification.
    • Status: (enum) Status of the lead:
      • 0 – New
      • 1 – Qualified
      • 2 – Disqualified
      • 3 – Evaluating
      • 4 – Unknown
      • 5 – Previously entered
    • Reason: (string) Disqualification reason.
    • SourceId: (enum) Source of the lead
      • 0 – None
      • 1 – Email
      • 2 – PhoneIn
      • 3 – ColdCall
      • 4 – WebForm
      • 5 – Other
    • Source: (string) Name of the source enum
    • CustomSourceId: (int) Not 0 if custom sources are used.
    • CustomSourceName: (string) Name of the custom source.
    • ContactInfos: (contact-info object array) Contact information
    • Tags: (string array) Associated tags for the record.
    • Owner: (user object) Owner of the record. 
    • ProfilePictures: (object) Urls of the image associated with the record. (Small/Medium/Large/Original)
    • Regions: (object array) Custom region properties of the record.
      • Id: (int) Unique Region Id
      • Name: (string) Region name
    • RelationshipTypes: (object array) Custom relationship property.
      • Id: (int) Unique Relationship Id
      • Name: (string Relationship type name
    • LastActivityDate: (datetime) UTC Latest activity 
    • ModifiedDate: (datetime) UTC Latest modification 
    • ModifiedByIndividual: (user object) Information about the user that modified the record.
    • EnteredDate: (datetime) UTC Creation 
    • EnteredByIndividual: (user object) Information about the user that created the record.
    • CustomFieldDatas: (custom-field object array) Custom field values of the record.

Lead Updated

  • EventAction: (string) “Update”
  • EventEntity: (string) “Lead”
  • Data: (lead object)

Lead Deleted

  • EventAction: (string) “Delete”
  • EventEntity: (string) “Lead”
  • Data: (lead object)

Product Created

  • EventAction: (string) “New”
  • EventEntity: (string) “Product”
  • Data: (product object)
    • Id: (int) Unique TeamGram Id for the record.
    • Name: (string) Name of the product.
    • Brand: (string) Brand of the product.
    • Model: (string) Model of the product.
    • DisplayName: (string) Full name of the product.
    • SKU: (string) Stock keeping unit for the product.
    • Price: (decimal) Product price.
    • CurrencyName: (string) currency symbol of the product price. (USD)
    • PurchasePrice: (decimal) Product purchase price.
    • PurchaseCurrencyName: (string) currency symbol of the purchase price.
    • VAT: (decimal) Vat for the product.
    • Unit: (string) Unit of the product.
    • Description: (string) Long text description.
    • NotAvailable: (bool) Active/Passive switch.
    • Inventory: (decimal) Remaining inventory quantity
    • Category: (object) Category of the product:
      • Id: (int) Unique category Id
      • Name: (string) Category name
    • Tags: (string array) Associated tags for the record.
    • Owner: (user object) Owner of the record. 
    • ProfilePictures: (object) Urls of the image associated with the record. (Small/Medium/Large/Original)
    • Regions: (object array) Custom region properties of the record.
      • Id: (int) Unique Region Id
      • Name: (string) Region name
    • RelationshipTypes: (object array) Custom relationship property.
      • Id: (int) Unique Relationship Id
      • Name: (string Relationship type name
    • LastActivityDate: (datetime) UTC Latest activity 
    • ModifiedDate: (datetime) UTC Latest modification 
    • ModifiedByIndividual: (object) Information about the user that modified the record.
    • EnteredDate: (datetime) UTC Creation 
    • EnteredByIndividual: (user object) Information about the user that created the record.
    • CustomFieldDatas: (custom-field object array) Custom field values of the record.

Product Updated

  • EventAction: (string) “Update”
  • EventEntity: (string) “Product”
  • Data: (product object)

Product Deleted

  • EventAction: (string) “Delete”
  • EventEntity: (string) “Product”
  • Data: (product object)

Opportunity Created

  • EventAction: (string) “New”
  • EventEntity: (string) “Opportunity”
  • Data: (opportunity object)
    • Id: (int) Unique TeamGram Id for the record.
    • Name: (string) Name of the opportunity.
    • Description: (string) Long text description.
    • RelatedEntity: (customer object) Customer of the opportunity.
    • Attn: (customer object) Contact person of the customer for the opportunity.
    • Items: (line-item array) Pricing table of the products for the record.
    • Probability: (decimal) Probability of the opportunity
    • Amount: (decimal) Value of the opportunity.
    • CurrencyName: (string) currency symbol of the opportunity amount. (USD)
    • RealizedAmount: (decimal) Value of the WON opportunity.
    • RealizedCurrenyName: (string) currency symbol.
    • Profit: (decimal) Calculated profit from the pricing table.
    • ProfitCurrenyName: (string) currency symbol.
    • TotalCost: (decimal) Calculated cost from the pricing table.
    • ExpectedClosingDate: (datetime) Expected closing date.
    • Status: (enum) Status of the opportunity:
      • 0: Open active
      • 1: Open on hold
      • 2: Closed won
      • 3: Closed lost
      • 4: Closed abandoned
      • 5: Closed cancelled
    • Stage: (enum) Stage of the opportunity:
      • 0: None
      • 1: IdentifyingContacts
      • 2: Contacted
      • 3: RequestForProposal
      • 4: ProposalSubmitted
      • 5: Contract
    • CustomStageId: (int) Not 0 if custom stages are used.
    • CustomStageName: (string) Custom stage name.
    • LostReason: (enum) Reason if opportunity is lost:
      • 0: None
      • 1: HighPrices
      • 2: PaymentTerms
      • 3: DeliveryTime
      • 4: WarrantyTerms
      • 5: Other
    • Reason: (string) Custom lost reason text.
    • CustomPipelineName: (string) Name of the opportunity pipeline.
    • CloseDate: (datetime) Date if opportunity is closed
    • ClosedBy: (user object) Who closed the opportunity.
    • RelatedEntities: (object array) Other relations for the opportunity.
    • ContactInfos: (contact-info object array) Contact information
    • Tags: (string array) Associated tags for the record.
    • Owner: (user object) Owner of the record. 
    • Regions: (object array) Custom region properties of the record.
      • Id: (int) Unique Region Id
      • Name: (string) Region name
    • RelationshipTypes: (object array) Custom relationship property.
      • Id: (int) Unique Relationship Id
      • Name: (string Relationship type name
    • LastActivityDate: (datetime) UTC Latest activity 
    • ModifiedDate: (datetime) UTC Latest modification 
    • ModifiedByIndividual: (object) Information about the user that modified the record.
    • EnteredDate: (datetime) UTC Creation 
    • EnteredByIndividual: (user object) Information about the user that created the record.
    • CustomFieldDatas: (customfield object array) Custom field values of the record.

Opportunity Updated

  • EventAction: (string) “Update”
  • EventEntity: (string) “Opportunity”
  • Data: (opportunity object)

Opportunity Deleted

  • EventAction: (string) “Delete”
  • EventEntity: (string) “Opportunity”
  • Data: (opportunity object)

Order Created

  • EventAction: (string) “New”
  • EventEntity: (string) “Order”
  • Data: (order object)
    • Id: (int) Unique TeamGram Id for the record.
    • Name: (string) Name of the order.
    • DisplayName: (string) Full name of the order. (including #reference)
    • Description: (string) Long text description.
    • RelatedEntity: (customer object) Customer of the order.
    • Attn: (customer object) Contact person of the customer for the order.
    • Items: (line-item array) Pricing table of the products for the record.
    • DiscountedTotal: (decimal) Total of the pricing table (discounts applied).
    • CurrencyName:  (string) currency symbol.
    • Discount: (decimal) Total discount applied.
    • DiscountType: (enum)
      • 0 – PercentOff
      • 1 – AmountOff
    • Deposit: (decimal) Deposit taken for the order.
    • VatType: (enum)
      • 0 – No vat
      • 1 – Vat exclusive
      • 2 – Vat inclusive
    • Profit: (decimal) Calculated profit from the pricing table.
    • ProfitCurrenyName: (string) currency symbol.
    • TotalCost: (decimal) Calculated cost from the pricing table.
    • OrderDate: (datetime) Date of the order taken.
    • ScheduledFulfilment: (datetime) Estimated fulfillment date.
    • ActualFulfilment: (datetime) Actual fulfillment date if fulfilled.
    • Status: (enum) Status of the order:
      • 0: Open new
      • 1: Closed fulfilled.
      • 2: Closed cancelled.
    • Stage: (enum) Stage of the order:
      • 0: None
      • 1: Pending
      • 2: Processing
      • 3: Shippped
    • CustomStageId: (int) Not 0 if custom stages are used.
    • CustomStageName: (string) Custom stage name.
    • DeliveryAddress: (string) Order delivery address.
    • CustomerPhone: (string) Order customer phone.
    • BillingAddress: (string) Order billing address.
    • RelatedEntities: (object array) Other relations for the opportunity.
    • Tags: (string array) Associated tags for the record.
    • Owner: (user object) Owner of the record. 
    • LastActivityDate: (datetime) UTC Latest activity 
    • ModifiedDate: (datetime) UTC Latest modification 
    • ModifiedByIndividual: (object) Information about the user that modified the record.
    • EnteredDate: (datetime) UTC Creation 
    • EnteredByIndividual: (user object) Information about the user that created the record.
    • CustomFieldDatas: (customfield object array) Custom field values of the record.

Order Updated

  • EventAction: (string) “Update”
  • EventEntity: (string) “Order”
  • Data: (order object)

Order Deleted

  • EventAction: (string) “Delete”
  • EventEntity: (string) “Order”
  • Data: (order object)

Objects

Definitions for common object types used in webhooks.

User

  • Id: (int) Unique TeamGram Id for the record.
  • Name: (string) First name.
  • LastName: (string) Last name.
  • DisplayName: (string) Full name.

Contact-info

  • ContactInfoTypeName: (string) one of “Address”, “Email”, “Phone”, “Social”, “Web”, “Date”
  • ContactInfoSubType: (string) one of “Business”, “Delivery”, “Direct”, “Personal”, “Home”, “Mobile”, “Other”, “Work”
  • Value: (string) Value of the info.
  • Extension: (string) Used if subtype if “Direct”
  • SpecialDate: (datetime) Used if type is “Date”

Custom-field

  • CustomFieldId: (int) Unique Id of the custom field.
  • CustomFieldName: (string) Field name.
  • CustomFieldType: (int) Field type enum:
    • 0 – single line text
    • 1 – multi line text
    • 2 – number
    • 3 – date 
    • 4 – datetime 
  • Value: (string) Field value.

Line-item

  • ItemId: (int) Unique Id of the custom field.
  • Product: (product object)
  • Quantity: (decimal)
  • Price: (decimal)
  • LineTotal: (decimal) Price*Quantity
  • CurrencyName: (string) Currency symbol
  • Description: (string)
  • Vat: (decimal)
  • Discount: (decimal) Line item discount.
  • DiscountType: (enum) 
    • 0 – PercentOff
    • 1 – AmountOff
  • Unit: (string) Unit of the product.
  • UnitCost: (decimal)
  • UnitCostCurrencyName (string) Currency symbol

Customer

  • Id: (int) Unique TeamGram Id for the record.
  • Name: (string) First name.
  • LastName: (string) Last name.
  • DisplayName: (string) Full name.
  • ClassName: (string) “Individual” (person) or “Party” (company)
  • ContactInfos: (contact-info array) Contact infos

Was this article helpful?

Related Articles