OnAutomate API V1.1.1
Welcome to onautomate Api docs.
Opportunity
GET /v1/pipelines/:pipelineId/opportunities
https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities?page=1
Get opportunities.
FILTERS
Fetching opportunities api are coming with these filters.
1. title*: Opportunity Title
2. stageId*: Pipeline stage id
3. status*: Opportunity Status. Valid options: open, won, lost and abandoned
4. monetaryValue: Opportunity Lead value.
5. assignedTo: Assigned Opportunity to a specific user.
6. contactId/Email*: Contact Id or email. If you have already contact and just want to create an appointment for the selected contact then just pass contactId. If you want create or find contact and create an opportunity then pass email.
7. name: Contact Name.
8. phone: Contact Phone (required if contactId or email are empty).
9. tags: Contact tags. Will allow array.
10. companyName: Contact company name.
Validation:
1. opportunity: If your contact have already one opportunity in the pipeline and trying to add new one. Then It will be throw error. If you allow duplicate opportunity then it will allow duplicate opportunity.
Pagination:
We will by default return the first matched 20 opportunities. You can fetched next and more by passing the page on the query params. You can see page info and total records count on to the meta
AUTHORIZATION
Bearer Token
Token
<token>
PARAMS
page
1
Page No
PATH VARIABLES
pipelineId
bCkKGpDsyPP4peuKowkG
(Required) Pipeline Id
Example Request
curl --location --request GET 'https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities?page=1' \
--header 'Authorization: Bearer <token>'
Example Response
Unauthorized
Bad Request. please contact support!
401 Unauthorized
BODY
{
"msg": "Unauthorized"
}
400 Bad Request
BODY
{
"msg": "Bad Request"
}
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Successful response
200 OK
Headers
Content-Type: application/json
GET /v1/pipelines/:pipelineId/opportunities/:opportunityId
https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities/:opportunityId
AUTHORIZATION
Bearer Token
Token
<token>
PATH VARIABLES
pipelineId
bCkKGpDsyPP4peuKowkG
(Required) Pipeline Id
opportunityId
123akv4LFn6C9frZoy3e
(Required) Opportunity Id
Example Request
curl --location --request GET 'https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities/:opportunityId' \
--header 'Authorization: Bearer <token>'
Example Response
Unauthorized
Bad Request. please contact support!
{
"msg": "Unauthorized"
}
{
"msg": "Bad Request"
}
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Successful response
200 OK
BODY
{
"id": "7XExm1wr8gFeZpl6rQny",
"name": "First Opp",
"monetaryValue": 120,
"pipelineId": "bCkKGpDsyPP4peuKowkG",
"pipelineStageId": "8b897c8f-b859-49c1-88f2-ed590708a85c",
"assignedTo": "hxHGVRb1YJUscrCB8eXK",
"status": "open",
"source": "form",
"lastStatusChangeAt": "2020-10-29T09:39:35.472Z",
"createdAt": "2020-10-29T09:31:30.255Z",
"updatedAt": "2020-10-29T09:44:02.263Z",
"contact": {
"id": "byMEV0NQinDhq8ZfiOi2",
"name": "John Deo",
"companyName": "Tesla Inc",
"email": "john@deo.com",
"phone": "+1202-555-0107",
"tags": [
"cillum sunt in enim",
"ea"
]
}
}
Headers
Content-Type: application/json
PUT /v1/pipelines/:pipelineId/opportunities/:opportunityId
https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities/:opportunityId
Update Opportunity.
FIELDS
1. title*: Opportunity Title
2. stageId*: Pipeline stage id
3. status*: Opportunity Status. Valid options: open, won, lost and abandoned
4. monetaryValue: Opportunity Lead value.
5. assignedTo: Assigned Opportunity to a specific user.
6. contactId/Email*: Contact Id or email. If you have already contact and just want to create an appointment for the selected contact then just pass contactId. If you want create or find contact and create an opportunity then pass email.
7. name: Contact Name.
8. phone: Contact Phone (required if contactId or email are empty).
9. tags: Contact tags. Will allow array.
10. companyName: Contact company name.
AUTHORIZATION
Bearer Token
Token
<token>
HEADERS
Content-Type
application/json
PATH VARIABLES
pipelineId
bCkKGpDsyPP4peuKowkG
(Required) Pipeline Id
opportunityId
123akv4LFn6C9frZoy3e
(Required) Opportunity Id
BODY raw
{
"title": "First Opp",
"status": "open",
"stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10",
"email": "elon@musk.com",
"phone": "+1202-555-0107",
"assignedTo": "082goXVW3lIExEQPOnd3",
"monetaryValue": 122.22,
"source": "public api",
"contactId": "mTkSCb1UBjb5tk4OvB69",
"name": "Elon Musk",
"companyName": "Tesla",
"tags": [
"Excepteur dolore ut",
"veniam ut occaecat amet pariatur"
]
}
Example Request
curl --location --request PUT 'https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities/:opportunityId' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"title": "First Opp",
"status": "open",
"stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10",
"email": "elon@musk.com",
"phone": "+1202-555-0107",
"assignedTo": "082goXVW3lIExEQPOnd3",
"monetaryValue": 122.22,
"source": "public api",
"contactId": "mTkSCb1UBjb5tk4OvB69",
"name": "Elon Musk",
"companyName": "Tesla",
"tags": [
"ea reprehenderit",
"ut Lorem laboris"
]
}'
Example Response
Successful Response
Unprocessable Entity
200 OK
BODY
{
"id": "7XExm1wr8gFeZpl6rQny",
"name": "First Opp",
"monetaryValue": 120,
"pipelineId": "bCkKGpDsyPP4peuKowkG",
"pipelineStageId": "8b897c8f-b859-49c1-88f2-ed590708a85c",
"assignedTo": "hxHGVRb1YJUscrCB8eXK",
"status": "open",
"source": "form",
"lastStatusChangeAt": "2020-10-29T09:39:35.472Z",
"createdAt": "2020-10-29T09:31:30.255Z",
"updatedAt": "2020-10-29T09:44:02.263Z",
"contact": {
"id": "byMEV0NQinDhq8ZfiOi2",
"name": "John Deo",
"companyName": "Tesla Inc",
"email": "john@deo.com",
"phone": "+1202-555-0107",
"tags": [
"incididunt quis veniam Lo",
"mollit nisi dolore proident"
]
}
}
422 Unprocessable Entity (WebDAV) (RFC 4918)
BODY
{
"title": {
"message": "The title field is mandatory.",
"rule": "required"
},
"status": {
"message": "The status field is mandatory.",
"rule": "required"
},
"stageId": {
"message": "The stage id field is mandatory.",
"rule": "required"
},
"contactId or email": {
"message": "The contactId or email field is mandatory.",
"rule": "required"
}
}
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Bad Request. please contact support!
Unauthorized
400 Bad Request
Body
{
"msg": "Bad Request"
}
400 Bad Request
Body
{
"msg": "Unauthorized"
}
Headers
Content-Type: application/json
Headers
Content-Type: application/json
DEL /v1/pipelines/:pipelineId/opportunities/:opportunityId
https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities/:opportunityId
AUTHORIZATION
Bearer Token
Token
<token>
PATH VARIABLES
pipelineId
bCkKGpDsyPP4peuKowkG
(Required) Pipeline Id
opportunityId
123akv4LFn6C9frZoy3e
(Required) Opportunity Id
Example Request
curl --location --request DELETE 'https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities/:opportunityId' \
--header 'Authorization: Bearer <token>'
Example Response
Successful response
Unauthorized
Bad Request. please contact support!
200 OK
Body
""
200 OK
Body
{
"msg": "Unauthorized"
}
200 OK
Body
{
"msg": "Bad Request"
}
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Headers
Content-Type: application/json
POST /v1/pipelines/:pipelineId/opportunities/
https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities/
Create opportunity.
FIELDS
1. title*: Opportunity Title
2. stageId*: Pipeline stage id
3. status*: Opportunity Status. Valid options: open, won, lost and abandoned
4. monetaryValue: Opportunity Lead value.
5. assignedTo: Assigned Opportunity to a specific user.
6. contactId/Email*: Contact Id or email. If you have already contact and just want to create an appointment for the selected contact then just pass contactId. If you want create or find contact and create an opportunity then pass email.
7. name: Contact Name.
8. phone: Contact Phone (required if contactId or email are empty).
9. tags: Contact tags. Will allow array.
10. companyName: Contact company name.
AUTHORIZATION
Bearer Token
Token
<token>
HEADERS
Content-Type
application/json
PATH VARIABLES
pipelineId
bCkKGpDsyPP4peuKowkG
(Required) Pipeline Id
BODY raw
{
"title": "First Opp",
"status": "open",
"stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10",
"email": "elon@musk.com",
"phone": "+1202-555-0107",
"assignedTo": "082goXVW3lIExEQPOnd3",
"monetaryValue": 122.22,
"source": "public api",
"contactId": "mTkSCb1UBjb5tk4OvB69",
"name": "Elon Musk",
"companyName": "Tesla",
"tags": [
"ea reprehenderit",
"ut Lorem laboris"
]
}
Example Request
curl --location --request POST 'https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities/' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"title": "First Opp",
"status": "open",
"stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10",
"email": "elon@musk.com",
"phone": "+1202-555-0107",
"assignedTo": "082goXVW3lIExEQPOnd3",
"monetaryValue": 122.22,
"source": "public api",
"contactId": "mTkSCb1UBjb5tk4OvB69",
"name": "Elon Musk",
"companyName": "Tesla",
"tags": [
"ea reprehenderit",
"ut Lorem laboris"
]
}'
Example Response
Successful response
Unprocessable Entity
200 OK
BODY
{
"id": "7XExm1wr8gFeZpl6rQny",
"name": "First Opp",
"monetaryValue": 120,
"pipelineId": "bCkKGpDsyPP4peuKowkG",
"pipelineStageId": "8b897c8f-b859-49c1-88f2-ed590708a85c",
"assignedTo": "hxHGVRb1YJUscrCB8eXK",
"status": "open",
"source": "form",
"lastStatusChangeAt": "2020-10-29T09:39:35.472Z",
"createdAt": "2020-10-29T09:31:30.255Z",
"updatedAt": "2020-10-29T09:44:02.263Z",
"contact": {
"id": "byMEV0NQinDhq8ZfiOi2",
"name": "John Deo",
"companyName": "Tesla Inc",
"email": "john@deo.com",
"phone": "+1202-555-0107",
"tags": [
"incididunt quis veniam Lo",
"mollit nisi dolore proident"
]
}
}
422 Unprocessable Entity (WebDAV) (RFC 4918)
BODY
{
"title": {
"message": "The title field is mandatory.",
"rule": "required"
},
"status": {
"message": "The status field is mandatory.",
"rule": "required"
},
"stageId": {
"message": "The stage id field is mandatory.",
"rule": "required"
},
"contactId or email": {
"message": "The contactId or email field is mandatory.",
"rule": "required"
}
}
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Bad Request. please contact support!
Unauthorized
400 Bad Request
{
"msg": "Bad Request"
}
401 Unauthorized
{
"msg": "Unauthorized"
}
Headers
Content-Type: application/json
Headers
Content-Type: application/json
PUT /v1/pipelines/:pipelineId/opportunities/:opportunityId/status
https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities/:opportunityId/status
Update opportunity status and stage.
Authorization:
Provide your location api key (Bearer Token).
AUTHORIZATION
Bearer Token
Token
<token>
HEADERS
Content-Type
application/json
PATH VARIABLES
pipelineId
bCkKGpDsyPP4peuKowkG
(Required) Pipeline Id
opportunityId
123akv4LFn6C9frZoy3e
(Required) Opportunity Id
BODY raw
{
"status": "open",
"stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10"
}
Example Request
curl --location --request PUT 'https://link.amtssl.com/v1/pipelines/:pipelineId/opportunities/:opportunityId/status' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"status": "open",
"stageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10"
}'
Example Response
Unprocessable Entity
Bad Request. please contact support!
Unauthorized
Successful response
422 Unprocessable Entity (WebDAV) (RFC 4918)
Body
{
"status": {
"message": "The status field is invalid.",
"rule": "invalid"
},
"stageId": {
"message": "The stage id field is invalid.",
"rule": "invalid"
}
}
400 Bad Request
Body
{
"msg": "Bad Request"
}
401 Unauthorized
Body
{
"msg": "Unauthorized"
}
200 OK
Body
""
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Headers
Content-Type: application/json