Community
Showing results for 
Search instead for 
Do you mean 
Reply

Creating opportunity with assgned contacts and companies

New Member
Posts: 3
Country: Poland

Creating opportunity with assgned contacts and companies

Hi,

 

my client is using act.com Version 21.0.295.0, Update 5. I've been asked to create Opportunities via API. I'd like to have Opportunity assigned to existing contact and company. Unfortunately all opportunities I created are not linked to neither contact nor company. Below I'm pasting some request I'm sending:

 

{
  "name": "Test Store",
  "companies": [
    {
      "id": "be1047dd-6f0a-4fa0-b42f-c5cdddf5caa7"
    }
  ],
  "contacts": [
    {
      "id": "b36c3090-f74a-41fc-8241-7bf137c082a9"
    }
  ],
  "estimatedCloseDate": "2019-05-29T10:54:44.160Z",
  "isPrivate": true,
  "openDate": "2019-04-29T10:54:44.160Z",
  "source": "Shopify App",
  "status": "Open",
  "relatedEntitiesResolver": true
}

Can you help with that? I've no idea what I may be doing wrong. 


Thanks in advance!

Highlighted
Employee
Posts: 115
Country: USA

Re: Creating opportunity with assgned contacts and companies

I was able to post a new opportunity with your json request (replace guids with my contact and company) it worked fine. I am assuming you are getting back a 201 Created status code with a response body, correct? I did notice a few things, but they seems to be linked.  Could you run your test again, but this time post the response body.

 

Here is the test I ran:  Everything looks correct, except for the stuff highlighted in red, I will look at these as well.  But I can't duplicate what you are seeing,  I have contacts and companies assigned.  Also in Act! I can see that these are associated on the opporutnities tabs for contacts and companies.  If you send more information to help me duplicate this issue, that would be helpful.

 

POST: api/opportunities

{
  "name": "Test Store",
  "companies": [
    {
      "id": "ad50fc98-96fe-4c29-946c-8b7f9d7b9c6f"
    }
  ],
  "contacts": [
    {
      "id": "214c6aef-b73e-474b-b0a9-e549dd069532"
    }
  ],
  "estimatedCloseDate": "2019-05-29T10:54:44.160Z",
  "isPrivate": true,
  "openDate": "2019-04-29T10:54:44.160Z",
  "source": "Shopify App",
  "status": "Open",
  "relatedEntitiesResolver": true
}

This was the response:

{
    "id": "4ec39172-a68d-4da3-b9ef-7e9bbb41c566",
    "name": "Test Store",
    "actualCloseDate": "9999-12-31T00:00:00-07:00",
    "companies": [
        {
            "id": "ad50fc98-96fe-4c29-946c-8b7f9d7b9c6f",
            "name": "Untitled Company"
        }
    ],
    "competitor": null,
    "contactNames": "Stephen Mark Burton",
    "contacts": [
        {
            "id": "214c6aef-b73e-474b-b0a9-e549dd069532",
            "displayName": "Stephen Mark Burton"
        }
    ],
    "creator": "Stephen Mark Burton",
    "daysOpen": 22,
    "estimatedCloseDate": "2019-05-29T00:00:00-07:00",
    "grossMargin": 0,
    "groups": [],
    "isPrivate": false,
    "manager": "Stephen Mark Burton",
    "openDate": "2019-04-29T00:00:00-07:00",
    "probability": 10,
    "productTotal": 0,
    "reason": null,
    "source": "Shopify App",
    "sourceId": "00000000-0000-0000-0000-000000000000",
    "stage": {
        "id": "9a704183-7eb3-4999-a053-4bb79e1564a7",
        "name": "Initial Communication",
        "description": "",
        "number": 1,
        "probability": 10,
        "process": {
            "id": "2380e83d-cef4-4b6d-ad15-dc9a558431ab",
            "name": "Act! Sales Cycle",
            "description": "A suggested series of Opportunity Stages"
        }
    },
    "status": 0,
    "totalPerCompany": 0,
    "totalPerContact": 0,
    "totalPerGroup": 0,
    "weightedTotal": 0,
    "relatedEntitiesResolver": true,
    "customFields": {
        "opportunity_field_1": null,
        "opportunity_field_8": null,
        "opportunity_field_3": null,
        "opportunity_field_2": null,
        "opportunity_field_7": null,
        "opportunity_field_6": null,
        "opportunity_field_5": null,
        "opportunity_field_4": null
    },
    "created": "2019-05-21T12:17:32-07:00",
    "edited": "2019-05-21T12:17:32-07:00",
    "editedBy": "Stephen Mark Burton",
    "recordOwner": "Stephen Mark Burton",
    "recordManager": "Stephen Mark Burton"
}
New Member
Posts: 3
Country: Poland

Re: Creating opportunity with assgned contacts and companies

Hi Stephen,

 

thanks for your reply. I tried once again but still no luck. Below I'm pasting my request along with response. Can you take a look on this once again please?

Request:

{
  "name": "Test Store 2019",
  "companies": [
    {
      "id": "e6e5b8e6-f30a-45f4-bca7-d182585271a5"
    }
  ],
  "contacts": [
    {
      "id": "56029c0d-bd3a-4008-ad6f-9b27d54411f2"
    }
  ],
  "estimatedCloseDate": "2019-06-23T14:46:16.366Z",
  "isPrivate": true,
  "openDate": "2019-05-23T14:46:16.366Z",
  "source": "Norsk Shopify App",
  "status": "Open",
  "relatedEntitiesResolver": true
}


and response:

{
  "id": "aa552bf6-ac08-44ba-a744-103a6a10cc00",
  "name": "Test Store 2019",
  "actualCloseDate": "9999-12-31T00:00:00+00:00",
  "companies": [],
  "competitor": "nil",
  "contactNames": "",
  "contacts": [],
  "creator": "administrator",
  "daysOpen": 0,
  "estimatedCloseDate": "2019-06-23T00:00:00+01:00",
  "grossMargin": 0.0,
  "groups": [],
  "isPrivate": false,
  "manager": "administrator",
  "openDate": "2019-05-23T00:00:00+01:00",
  "probability": 0,
  "productTotal": 0.0,
  "reason": "nil",
  "source": "nil",
  "sourceId": "00000000-0000-0000-0000-000000000000",
  "stage": {
    "id": "e7680d48-8dc8-45ab-b13d-49ac270a536b",
    "name": "Lead",
    "description": "",
    "number": 1,
    "probability": 0,
    "process": {
      "id": "1c15676b-3278-4564-a147-6f6655bcb3c9",
      "name": "Supply Chain",
      "description": ""
    }
  },
  "status": 0,
  "totalPerCompany": 0.0,
  "totalPerContact": 0.0,
  "totalPerGroup": 0.0,
  "weightedTotal": 0.0,
  "relatedEntitiesResolver": true,
  "customFields": {
    "opportunity_field_1": "nil",
    "cust_monthlytotal_035340332": "0.000000",
    "opportunity_field_8": "nil",
    "integration_type": "nil",
    "number_of_shipments_per_month": "nil",
    "opportunity_field_3": "nil",
    "reason_for_lost_opportunity": "nil",
    "opportunity_field_2": "nil",
    "opportunity_field_7": "nil",
    "opportunity_field_6": "nil",
    "opportunity_field_5": "nil",
    "opportunity_field_4": "nil"
  },
  "created": "2019-05-23T13:47:12+01:00",
  "edited": "2019-05-23T13:47:13+01:00",
  "editedBy": "administrator",
  "recordOwner": "administrator",
  "recordManager": "administrator"
}


also attaching a screenshot from actweb:

Zrzut ekranu 2019-05-23 o 14.49.04.png