Table of contents

    Overview

    OpportunityTemplate endpoint can be used to create a new opportunity. Clients can create, edit or archive opportunity templates in ARM customisations. To call the opportunity template endpoint, use one of the URLs from the following table:

    URL GET PUT POST DELETE
    https://api.mypcorp.com/opportunityTemplate
    https://api.mypcorp.com/opportunityTemplate/{TemplateGuid}

    Get

    The following table illustrates which fields can be included when receiving a GET response.

    NB: Nested properties are hidden by default. To expand all nested properties, add a query parameter $expand=* to the URL.

    OpportunityTemplate
    Field Description
    TemplateGuid
    Guid (Identifier)
    Opportunity id.
    TemplateName
    string
    Name of the opportunity template.
    OpportunityName
    string
    The name of the opportunity.
    Source
    string
    The type of source where this opportunity originated from. If this field is not null, then field ‘SourceDetails’ becomes available. If the value of ‘OpportunitySource’ is ‘Referral’, then ‘SourceDetails’ is not available, but instead ‘ReferrerEmail’, ‘ReferrerOrganisation’, ‘ReferrerFirstName’ and ‘ReferrerLastName’ become available.
    Possible values are:
    “CallCold”
    “CallWarm”
    “ClientCustomer”
    “EMarketing”
    “MarketingEvent”
    “Referral”
    “SearchEngine”
    “Training”
    “SocialMedia”
    “Other”
    SourceDetails
    string
    This is a description of where this opportunity originated from. This field is only available if ‘OpportunitySource’ field is not null. If a value of ‘Referral’ is set to ‘OpportunitySource’, then this field is not available.
    ReferrerEmail
    string
    Email of the person who referred this opportunity. This field is only available if ‘OpportunitySource’ field has a value of ‘Referral’.
    ReferrerFirstName
    string
    First name of the person who referred this opportunity. This field is only available ‘OpportunitySource’ field has a value of ‘Referral’.
    ReferrerLastName
    string
    Last name of the person who referred this opportunity. This field is only available ‘OpportunitySource’ field has a value of ‘Referral’.
    ReferrerOrganisation
    string
    Organisation that referred this opportunity. This field is only available ‘OpportunitySource’ field has a value of ‘Referral’.
    UpfrontValueOfSale
    decimal
    The upfront value of sale in AUD.
    ChanceOfSales
    decimal
    Percentage change of sales.
    RecurringAnnualValue
    decimal
    The recurring annual value in AUD.
    ExpiryDateInterval
    integer
    How many days to add to ExpiryDate when creating a new opportunity from this template.
    FollowUpDateInterval
    integer
    How many days to add to ExpiryDate when creating a new opportunity from this template.
    ArchiveDate
    datetime
    Date when the OpportunityTemplate was archived, if it has been archived.
    OpportunityOwner
    object
    Staff member who owns this opportunity.
    Team
    object
    The team to which this opportunity belongs to.
    Type
    object
    The type of opportunity this is. E.g. ‘Business’, ‘Partner’, ‘Training’, etc.
    Stage
    object
    The stage where this opportunity is at.
    FollowUpStaff
    object
    Staff member to follow up.

    Example JSON response format:

    {
      "@odata.context": "https://api.mypcorp.com/$metadata#Opportunity(OpportunityOwner(),PrimaryContact(),Team(),OpportunityType(),OpportunityStage(),FollowUpStaff(),OpportunityOutcomeReason())",
      "value": [
        {
          "TemplateGuid": "B0E620A7-F9B8-4527-BA28-B2B9A8786CB4",
          "TemplateName": "Community Services Client",
          "OpportunityName": "Community Services Client",
          "Source": "ClientCustomer",
          "SourceDetails": "Client introduced this opportunity",
          "ReferrerEmail": "lskywalker@yahoo.com",
          "ReferrerFirstName": "Luke",
          "ReferrerLastName": "Skywalker",
          "ReferrerOrganisation": "Muller Inc",
          "UpfrontValueOfSale": 100.0,
          "ChanceOfSales": 0.5,
          "RecurringAnnualValue": 50.0,
          "ExpiryDateInterval": 90,
          "FollowUpDateInterval": 30,
          "ArchiveDate": null,
          "OpportunityOwner": {
            "StaffGuid": "B6DFFC66-48A5-4540-A747-9D38630E0371",
            "FirstName": "Bruce",
            "LastName": "Wayne",
            "ArchiveDate": null
          },
          "Team": {
            "TeamId": 164,
            "Name": "Executive",
            "ArchiveDate": null
          },
          "Type": {
            "TypeId": 42,
            "Name": "Plan management",
            "ArchiveDate": null
          },
          "Stage": {
            "StageId": 42,
            "Name": "Proposal",
            "ArchiveDate": null
          },
          "FollowUpStaff": {
            "StaffGuid": "00CF9FC0-711F-4DDD-B18E-0640F63E5DDA",
            "FirstName": "Morticia",
            "LastName": "Addams",
            "ArchiveDate": null
          }
        }
      ]
    }

    Previous article Next article