Difference between revisions of "Update the Opportunity Details"
Ashley DeBon (talk | contribs) (Created page with "== Update Opportunity == === Base URL === https://apimobile.callproof.com === Endpoint === /api/opportunities/{id} === Purpose === Updates an existing opportunity, includin...") |
Ashley DeBon (talk | contribs) (→Successful Response (200)) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | == Update Opportunity == | + | == [[Mobile_API]] »Update Opportunity == |
=== Base URL === | === Base URL === | ||
| Line 61: | Line 61: | ||
| linked_contacts || string (JSON array) || No || JSON array of personnel IDs to link (replaces existing linked people) | | linked_contacts || string (JSON array) || No || JSON array of personnel IDs to link (replaces existing linked people) | ||
|} | |} | ||
| + | |||
| + | === cURL Example for Android === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/opportunities/YOUR_OPPORTUNITY_ID' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "opportunity_stage_id": YOUR_STAGE_ID, "owner_id": YOUR_OWNER_ID, "form_data": "[]", "opportunity_name": "", "opportunity_type_id": "", "value": "", "probability": "", "close_date": "", "notes": "", "linked_accounts": "[]", "linked_contacts": "[]" }' </pre> | ||
| + | |||
| + | === cURL Example for iOS === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/opportunities/YOUR_OPPORTUNITY_ID' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "opportunity_stage_id": YOUR_STAGE_ID, "owner_id": YOUR_OWNER_ID, "form_data": "[]", "opportunity_name": "", "opportunity_type_id": "", "value": "", "probability": "", "close_date": "", "notes": "", "linked_accounts": "[]", "linked_contacts": "[]" }' </pre> | ||
=== Successful Response (200) === | === Successful Response (200) === | ||
Latest revision as of 08:05, 21 July 2026
Contents
Mobile_API »Update Opportunity
Base URL
https://apimobile.callproof.com
Endpoint
/api/opportunities/{id}
Purpose
Updates an existing opportunity, including stage, owner, value, probability, close date, linked accounts/people, notes, and custom field values. Also records an opportunity history entry for the update.
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer access token |
Security
- Yes – Requires Bearer Token authentication.
Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Unique identifier of the opportunity to update |
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| opportunity_stage_id | integer | Yes | Opportunity stage identifier (must exist) |
| owner_id | integer | Yes | User ID of the opportunity owner (must exist) |
| form_data | string (JSON) | Yes | Custom field values for the opportunity (JSON string) |
| opportunity_name | string | No | Updated opportunity name |
| opportunity_type_id | integer | No | Opportunity type identifier |
| value | number | No | Opportunity value (numeric; values less than 1 are stored as 1) |
| probability | number | No | Win probability from 0 to 100 |
| close_date | string (date) | No | Expected close date |
| notes | string | No | Opportunity notes |
| linked_accounts | string (JSON array) | No | JSON array of contact/account IDs to link (replaces existing linked accounts) |
| linked_contacts | string (JSON array) | No | JSON array of personnel IDs to link (replaces existing linked people) |
cURL Example for Android
curl --location 'https://apimobile.callproof.com/api/opportunities/YOUR_OPPORTUNITY_ID' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "opportunity_stage_id": YOUR_STAGE_ID, "owner_id": YOUR_OWNER_ID, "form_data": "[]", "opportunity_name": "", "opportunity_type_id": "", "value": "", "probability": "", "close_date": "", "notes": "", "linked_accounts": "[]", "linked_contacts": "[]" }'
cURL Example for iOS
curl --location 'https://apimobile.callproof.com/api/opportunities/YOUR_OPPORTUNITY_ID' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "opportunity_stage_id": YOUR_STAGE_ID, "owner_id": YOUR_OWNER_ID, "form_data": "[]", "opportunity_name": "", "opportunity_type_id": "", "value": "", "probability": "", "close_date": "", "notes": "", "linked_accounts": "[]", "linked_contacts": "[]" }'
Successful Response (200)
Indicates that the opportunity was updated successfully.
| Field | Type | Description |
|---|---|---|
| clientStatusCode | integer | Status indicator for the client (for example, 200) |
| user_id | integer | Identifier of the authenticated user |
| company_id | integer | Identifier of the authenticated user’s company |
| message | string | Confirmation message (for example, "Opportunities Updated Successfully") |
| uri | string | Requested resource URI |
Error Responses
| Status Code | Meaning |
|---|---|
| 200 | Validation failed – response body uses clientStatusCode 401 with the first validation error message
|
| 500 | Server/update error – opportunity could not be updated |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- Validation (HTTP 200, clientStatusCode 401) – Missing/invalid
opportunity_stage_id,owner_id, orform_data; invalidclose_date,value, orprobability. - 500 – Opportunity not found, custom field update failure, or another update error (for example, "Error while Updating Opportunities").
- 401 – Authentication failed or the access token is missing/expired.