@@ -38,34 +38,31 @@ curl --location 'https://api.devrev.ai/schemas.custom.set' \
38
38
"fields": [
39
39
{
40
40
"name": "name",
41
- "type ": "string ",
41
+ "field_type ": "tokens ",
42
42
"description": "Name of the campaign"
43
43
},
44
44
{
45
45
"name": "start_date",
46
- "type ": "date",
46
+ "field_type ": "date",
47
47
"description": "Start date of the campaign"
48
48
},
49
49
{
50
50
"name": "end_date",
51
- "type ": "date",
51
+ "field_type ": "date",
52
52
"description": "End date of the campaign"
53
53
},
54
54
{
55
55
"name": "budget",
56
- "type ": "number ",
56
+ "field_type ": "int ",
57
57
"description": "Budget allocated for the campaign"
58
58
},
59
59
{
60
60
"name": "target_audience",
61
- "type ": "enum",
61
+ "field_type ": "enum",
62
62
"description": "Target audience for the campaign",
63
63
"allowed_values": [
64
- "young_adults",
65
- "seniors",
66
- "families",
67
- "professionals",
68
- "students"
64
+ "Professionals",
65
+ "Students"
69
66
]
70
67
}
71
68
],
@@ -84,17 +81,46 @@ curl --location 'https://api.devrev.ai/custom-objects.create' \
84
81
--data '{
85
82
"leaf_type": "campaign",
86
83
"custom_fields": {
87
- "name ": "Summer Sale 2023",
88
- "start_date ": "2023-06-01",
89
- "end_date ": "2023-08-31",
90
- "budget ": 10000,
91
- "target_audience ": "Young adults "
84
+ "tnt__name ": "Summer Sale 2023",
85
+ "tnt__start_date ": "2023-06-01",
86
+ "tnt__end_date ": "2023-08-31",
87
+ "tnt__budget ": 10000,
88
+ "tnt__target_audience ": "Professionals "
92
89
},
93
90
"unique_key": "CAMP-001"
94
91
}'
95
92
```
96
93
97
- The sections below provide more details on the available API endpoints for Custom Objects.
94
+ The response of the above API call will be the ID of the custom object created.
95
+ ```
96
+ {
97
+ "custom_object": {
98
+ "id": "don:core:dvrv-us-1:devo/11FVC3ScK:custom_object/campaign/1",
99
+ "created_by": {...},
100
+ "created_date": "2024-10-01T07:02:58.958Z",
101
+ "modified_by": {...},
102
+ "modified_date": "2024-10-01T07:02:58.958Z",
103
+ "display_id": "C-CAMP-1",
104
+ "leaf_type": "campaign",
105
+ "unique_key": "CAMP-001"
106
+ "stock_schema_fragment": "don:core:dvrv-us-1:stock_sf/1522526",
107
+ "custom_schema_fragments": [
108
+ "don:core:dvrv-us-1:devo/11FVC3ScK:tenant_fragment/261"
109
+ ],
110
+ "custom_fields": {
111
+ "tnt__budget": 10000,
112
+ "tnt__end_date": "2023-08-31",
113
+ "tnt__name": "Summer Sale 2023",
114
+ "tnt__start_date": "2023-06-01",
115
+ "tnt__target_audience": "Professionals"
116
+ },
117
+ }
118
+ }
119
+ ```
120
+
121
+ Note that the ` id ` field in the above response is the system generated ID for the custom object.
122
+
123
+ The sections below provide more details on the available API endpoints for interacting with Custom Objects.
98
124
99
125
### Get a Custom Object
100
126
@@ -106,8 +132,7 @@ curl --location 'https://api.devrev.ai/custom-objects.get' \
106
132
--header 'Accept: application/json' \
107
133
--header 'Authorization: <YOUR_API_TOKEN>' \
108
134
--data '{
109
- "leaf_type": "campaign",
110
- "id": "<OBJECT_ID>"
135
+ "id": "don:core:dvrv-us-1:devo/11FVC3ScK:custom_object/campaign/1"
111
136
}'
112
137
```
113
138
@@ -122,9 +147,11 @@ curl --location 'https://api.devrev.ai/custom-objects.list' \
122
147
--header 'Authorization: <YOUR_API_TOKEN>' \
123
148
--data '{
124
149
"leaf_type": "campaign",
125
- "filter": {
126
- "eq": ["custom_fields.target_audience", "Young adults"]
127
- }
150
+ "filter": [
151
+ "eq",
152
+ "$custom_fields.ctype__target_audience",
153
+ "Young adults"
154
+ ]
128
155
}'
129
156
```
130
157
@@ -138,10 +165,9 @@ curl --location 'https://api.devrev.ai/custom-objects.update' \
138
165
--header 'Accept: application/json' \
139
166
--header 'Authorization: <YOUR_API_TOKEN>' \
140
167
--data '{
141
- "leaf_type": "campaign",
142
- "id": "<OBJECT_ID>",
168
+ "id": "don:core:dvrv-us-1:devo/11FVC3ScK:custom_object/campaign/1",
143
169
"custom_fields": {
144
- "budget ": 15000
170
+ "tnt__budget ": 15000
145
171
}
146
172
}'
147
173
```
@@ -156,8 +182,8 @@ curl --location 'https://api.devrev.ai/custom-objects.delete' \
156
182
--header 'Accept: application/json' \
157
183
--header 'Authorization: <YOUR_API_TOKEN>' \
158
184
--data '{
159
- "id": "<OBJECT_ID> "
160
- }
185
+ "id": "don:core:dvrv-us-1:devo/11FVC3ScK:custom_object/campaign/1 "
186
+ }'
161
187
```
162
188
163
189
## Key Concepts
@@ -167,7 +193,7 @@ curl --location 'https://api.devrev.ai/custom-objects.delete' \
167
193
3 . ** Custom Fields** : User-defined fields that store specific data for your custom object.
168
194
4 . ** Unique Key** : A unique identifier for each custom object, useful for maintaining idempotency.
169
195
170
- For more details, please refer to the [ Customization] ( ./customization.mdx ) documentation.
196
+ For more details on customization concepts , please refer to the [ Customization] ( ./customization.mdx ) documentation.
171
197
172
198
## Custom Object Lifecycle
173
199
0 commit comments