-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrm.http
111 lines (82 loc) · 2.74 KB
/
crm.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
@hostname = https://ace.acrm.accessacloud.com
@apiPath = /rest/v10
@api = {{ hostname }}{{ apiPath }}
### Get list of methods
GET {{ api }}/help HTTP/1.1
### Auth Method
# @name authRequest
POST {{ api }}/oauth2/token
content-type: application/json
{
"grant_type":"password",
"client_id": "sugar",
"username": "{{ crmUsername }}",
"password": "{{ crmPassword }}",
"platform": "custom-crm-connector"
}
### Get contacts (only 20)
GET {{ api }}/Contacts?max_num=999999
Authorization: Bearer {{ authRequest.response.body.access_token }}
### Get events (only 20)
GET {{ api }}/cours_Event?max_num=999999
Authorization: Bearer {{ authRequest.response.body.access_token }}
### Get eventsattendances (only 20)
GET {{ api }}/cours_EventAttendance?max_num=999999
Authorization: Bearer {{ authRequest.response.body.access_token }}
### Filter contacts by email, with results
@emailToFind = testing-api-7628537@gavinhenderson.co.uk
GET {{ api }}/Contacts
?filter=[{"email": "{{ emailToFind }}" }]
Authorization: Bearer {{ authRequest.response.body.access_token }}
### Filter contacts by email, no results
GET {{ api }}/Contacts
?filter=[{"email":"totallymadeup"}]
Authorization: Bearer {{ authRequest.response.body.access_token }}
### Create Contact
@randomEmail = testing-api-{{ $randomInt 0 9999999 }}@gavinhenderson.co.uk
POST {{ api }}/Contacts
Authorization: Bearer {{ authRequest.response.body.access_token }}
content-type: application/json
{
"email1": "{{ randomEmail }}",
"first_name": "{{ randomEmail }}",
"last_name": "Unknown",
"receives_newsletter_c": false
}
### Create event attendence
POST {{ api }}/cours_EventAttendance
Authorization: Bearer {{ authRequest.response.body.access_token }}
content-type: application/json
{
"name": "temp test",
"cours_eventattendance_contacts": {
"add": ["0bd2f8e8-7a36-11ed-8822-00163ecfc8ed"]
},
"cours_event_cours_eventattendance": {
"add": ["3df50498-507d-11ed-988e-00163ecfc8ed"]
}
}
### Switch contact to recieve newsletter
@idToSubscribe = da95208e-69ab-11ed-ae8a-00163ecfc8ed
PUT {{ api }}/Contacts/{{ idToSubscribe }}
Authorization: Bearer {{ authRequest.response.body.access_token }}
content-type: application/json
{
"receives_newsletter_c": true
}
### Request to DO
POST https://crm-connector-k7gic.ondigitalocean.app/crm/crm-functions
Content-Type: application/json
{
"email": "123@gavinhenderson.co.uk",
"method": "add-to-newsletter",
"location": "rest"
}
### Request to DO
POST https://crm-connector-k7gic.ondigitalocean.app/crm/crm-functions
Content-Type: application/json
{
"email":"gavin.henderson@hotmail.co.uk",
"eventSlug": "developing-and-using-a-communication-book-i-10th-jan-23",
"method": "add-to-course"
}