Last modified by Admin on 2025/06/27 12:14

From version 7.1
edited by Admin
on 2017/04/05 10:57
Change comment: There is no comment for this version
To version 4.1
edited by sonish
on 2017/04/03 16:45
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -ONEcount API Documentation
1 +OC-API-04032017
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Admin
1 +XWiki.sonish
Content
... ... @@ -1,8 +1,56 @@
1 +(% class="western" align="center" %)
2 +
3 +
4 +(% class="western" align="center" %)
5 +
6 +
7 +(% class="western" align="center" %)
8 +
9 +
10 +(% class="western" align="center" %)
11 +
12 +
13 +(% class="western" align="center" %)
14 +
15 +
16 +(% class="western" align="center" %)
17 +
18 +
19 +(% class="western" align="center" %)
20 +ONEcount REST API Developer's Guide
21 +
22 +(% class="western" align="center" %)
23 +Version 2.1
24 +
25 +(% class="western" align="center" %)
26 +
27 +
28 +(% class="western" align="center" %)
29 +
30 +
31 +(% class="western" align="center" %)
32 +
33 +
34 +(% class="western" align="center" %)
35 +
36 +
37 +(% class="western" align="center" %)
38 +
39 +
40 +(% class="western" align="center" %)
41 +
42 +
43 +(% class="western" align="center" %)
44 +
45 +
46 +(% class="western" align="center" %)
47 +
48 +
1 1  (% class="western" %)
2 2  **Introduction**
3 3  
4 4  (% class="western" %)
5 -ONEcount REST API is designed to allow you to directly manipulate the underlying data within the ONEcount application. This API can be used to lookup, create and updated different ONEcount data components which are listed below.
53 +ONEcount REST API provides different functionality to accomplish many integration related tasks. This API can be used to lookup, create and updated different ONEcount resources which are listed below.
6 6  
7 7  (% class="western" %)
8 8  REST takes advantage of the HTTP request methods to layer itself into the existing HTTP architecture. These operations consist of the following:
... ... @@ -10,11 +10,14 @@
10 10  1. (((
11 11  (% class="western" %)
12 12  **GET** - Used for lookup of resources
13 -)))
61 +
62 +* (((
14 14  1. (((
15 15  (% class="western" %)
16 16  **PUT** - Used to update a resource
17 17  )))
67 +)))
68 +)))
18 18  1. (((
19 19  (% class="western" %)
20 20  **POST** - Used to create a new resource
... ... @@ -21,55 +21,178 @@
21 21  )))
22 22  
23 23  (% class="western" %)
24 -Specifically, the ONEcount API provides to the following components:
75 +ONEcount API provides following functionalities:
25 25  
26 -1. User data
27 -11. List users
28 -11. Lookup users
29 -11. Create users
30 -11. Update users
31 -1. Questions
32 -11. Lookup questions
33 -11. List questions
34 -11. Create questions
35 -1. Product data
36 -11. Lookup products
37 -11. Create products
38 -11. Update products
39 -1. Term Data
40 -11. Lookup terms
41 -11. Create terms
42 -11. Update terms
43 -1. Resource Data
44 -11. Lookup resources
45 -11. Create resources
46 -11. Update resources
47 -1. Transaction data
48 -11. Lookup transactions
49 -11. Create transactions
50 -1. Source Codes
51 -11. Lookup source code
52 -11. Create source codes
53 -11. Update source codes
54 -1. Attach a resource to a product
55 -1. Leads
56 -11. Create a lead
57 -\\\\\\
77 +1. (((
78 +(% class="western" %)
79 +**Lookup**
58 58  
81 +*
82 +
59 59  (% class="western" %)
60 -**Accessing API**
84 +User lookup
61 61  
86 +*
87 +
62 62  (% class="western" %)
63 -**REST API URL**: [[https:~~/~~/api.onecount.net/v2/>>url:https://api.onecount.net/v2/||shape="rect"]]
89 +Transaction lookup
64 64  
91 +*
92 +
65 65  (% class="western" %)
66 -**Appkey**: THIS WILL BE PROVIDED TO YOU
94 +Question lookup
67 67  
96 +*
97 +
68 68  (% class="western" %)
69 -**
70 -**
99 +Source code lookup
71 71  
101 +*
102 +
72 72  (% class="western" %)
104 +Product lookup
105 +
106 +*
107 +
108 +(% class="western" %)
109 +Term lookup
110 +
111 +*
112 +
113 +(% class="western" %)
114 +Resource lookup
115 +)))
116 +1. (((
117 +(% class="western" %)
118 +**Create**
119 +
120 +*
121 +
122 +(% class="western" %)
123 +Add a user/demo
124 +
125 +*
126 +
127 +(% class="western" %)
128 +Add a question
129 +
130 +*
131 +
132 +(% class="western" %)
133 +Add user transaction
134 +
135 +*
136 +
137 +(% class="western" %)
138 +Add source code
139 +
140 +*
141 +
142 +(% class="western" %)
143 +Add Product
144 +
145 +*
146 +
147 +(% class="western" %)
148 +Add Term
149 +
150 +*
151 +
152 +(% class="western" %)
153 +Add Resource
154 +
155 +*
156 +
157 +(% class="western" %)
158 +Stats – Telemarketing
159 +)))
160 +1. (((
161 +(% class="western" %)
162 +**Update**
163 +
164 +*
165 +
166 +(% class="western" %)
167 +Update a user/demo
168 +
169 +*
170 +
171 +(% class="western" %)
172 +Update a question
173 +
174 +*
175 +
176 +(% class="western" %)
177 +Update source code
178 +
179 +*
180 +
181 +(% class="western" %)
182 +Update product
183 +
184 +*
185 +
186 +(% class="western" %)
187 +Update term
188 +
189 +*
190 +
191 +(% class="western" %)
192 +Update resource
193 +)))
194 +1. (((
195 +(% class="western" %)
196 +**List**
197 +
198 +*
199 +
200 +(% class="western" %)
201 +ListQuestions
202 +
203 +*
204 +
205 +(% class="western" %)
206 +ListSourceCodes
207 +)))
208 +
209 +(% class="western" %)
210 +
211 +
212 +1. (((
213 +(% class="western" %)
214 +**Attach**
215 +)))
216 +
217 +* (((
218 +(% class="western" %)
219 +Attach resource to product
220 +)))
221 +
222 +(% class="western" %)
223 +
224 +
225 +(% class="western" %)
226 +
227 +
228 +(% class="western" %)
229 +**REST API URL**: [[https:~~/~~/api.onecount.net/v2/>>url:https://api.onecount.net/v2/||shape="rect" class="western"]]
230 +
231 +(% class="western" %)
232 +**Appkey**: THIS WILL BE PROVIDED
233 +
234 +(% class="western" %)
235 +
236 +
237 +(% class="western" %)
238 +**Function**
239 +
240 +(% class="western" %)
241 +The ONEcount REST API will be used to create, update & lookup users, transactions and questions e.t.c. in ONEcount hosted install of the client.
242 +
243 +(% class="western" %)
244 +**Accessing API**
245 +
246 +(% class="western" %)
73 73  Your HTTP requests to a REST API resource should contain the following information:
74 74  
75 75  * (((
... ... @@ -90,12 +90,9 @@
90 90  )))
91 91  
92 92  (% class="western" %)
93 -
267 +**Request**
94 94  
95 95  (% class="western" %)
96 -**General API Usage**
97 -
98 -(% class="western" %)
99 99  The request data in POST (for create and update) will consist of request parameters required by each method in JSON format. Value of resource will determine which resource is being requested and the access method will determine whether you are trying to create, update or lookup that resource.
100 100  
101 101  (% class="western" %)
... ... @@ -224,99 +224,133 @@
224 224  
225 225  
226 226  (% class="western" %)
227 -**
228 -**
398 +**Resources**
229 229  
230 -**COMPONENT: Users**
231 -
232 232  (% class="western" %)
233 -Users means the customers of your system. Users can be added, updated and searched for using the users resource from the api. For lookup, If a return parameter is specified Users object will have those fields. If nothing is specified by default only UserId is returned.
401 +Resources are the available entities that can be accessed/modified via API. Each resource can be created, updated or requested by using the corresponding http method described above.
234 234  
403 +* (((
235 235  (% class="western" %)
236 -Additionally (Array of) transaction object specifying parts of the transaction to be added to the new user can be specified. UserId, TransactionId and SubscriptionType will be ignored if specified for this case. As this is new user and new transaction is being added.
405 +questions
406 +)))
407 +* (((
408 +(% class="western" %)
409 +users
410 +)))
411 +* (((
412 +(% class="western" %)
413 +products
414 +)))
415 +* (((
416 +(% class="western" %)
417 +terms
418 +)))
419 +* (((
420 +(% class="western" %)
421 +resources
422 +)))
423 +* (((
424 +(% class="western" %)
425 +sources
426 +)))
427 +* (((
428 +(% class="western" %)
429 +transactions
430 +)))
237 237  
238 238  (% class="western" %)
239 -In this case the provided demographic information in users object will be used to create a new user in ONEcount and then a response will be generated. Before creating a new user, a check for duplicate will be performed based on Dedupe columns and if found, and error code will be generated.
433 +**Questions**
240 240  
241 241  (% class="western" %)
242 -If username and password is not one of the parameters being passed, then a random username and password will be generated for the user while creating his user account in ONEcount.
436 +This resource is for manipulating questions resource. Questions in ONEcount means any question that is asked to the subscriber. It could be any questions that appears on customer forms or print forms that gets answered by a subscriber. Questions api call will allow creation, update and search of question in ONEcount. To add a new questions to the system you'll make a POST api call to the questions resource.
243 243  
244 244  (% class="western" %)
245 -Return parameter will have the comma separated list of question Ids that is requested back from the API.
439 +The data that is sent should be in JSON format and of type questions as described in References section. The type property of questions object is described below. Questions object will only need a choices block if the question is a multiple choice question(type=4 or 5 or 6)
246 246  
247 247  (% class="western" %)
248 -Return is an optional parameter in request. If return is not requested then by default, only UserId (which is ONEcount ID) will be returned in the Users object.
442 +There can be 6 types of questions:
249 249  
250 -
251 -
444 +(% class="wrapped" %)
252 252  |(((
253 -(% class="western" %)
254 -**Method**
446 +(% class="western" align="center" %)
447 +**Type**
255 255  )))|(((
256 256  (% class="western" %)
257 -**Url**
450 +**Description**
451 +)))
452 +|(((
453 +(% class="western" align="center" %)
454 +1
258 258  )))|(((
259 259  (% class="western" %)
260 -**Action**
457 +Textbox type questions or short response type question. The response length needs to be less than 255 characters.
261 261  )))
262 262  |(((
263 -(% class="western" %)
264 -GET
460 +(% class="western" align="center" %)
461 +2
265 265  )))|(((
266 266  (% class="western" %)
267 -/users
464 +Textarea type question or long response type question.
465 +)))
466 +|(((
467 +(% class="western" align="center" %)
468 +3
268 268  )))|(((
269 269  (% class="western" %)
270 -Get users data limiting 25.
471 +Password type question. This is basically same as type 1 but when displayed in ONEcount frontend forms typed characters appears as *.
271 271  )))
272 272  |(((
474 +(% class="western" align="center" %)
475 +4
476 +)))|(((
273 273  (% class="western" %)
274 -GET
478 +Select or dropdown type questions. This is a multiple choice, 1 response type question. When creating this type of question the choices block also needs to be part of the questions object that will hold the possible choices of the select question.
479 +)))
480 +|(((
481 +(% class="western" align="center" %)
482 +5
275 275  )))|(((
276 276  (% class="western" %)
277 -/users/1
485 +Radio button type question. This is a multiple choice, 1 response type question. When creating this type of question the choices block also needs to be part of the questions object that will hold the possible choices of the radio question.
486 +)))
487 +|(((
488 +(% class="western" align="center" %)
489 +6
278 278  )))|(((
279 279  (% class="western" %)
280 -Get data for user id 1. The user id can be a numeric value or a hash
492 +Checkbox type question. This is a multiple choice, multi response type question. When creating this type of question the choices block also needs to be part of the questions object that will hold the possible choices of the checkbox question.
281 281  )))
494 +
495 +(% class="wrapped" %)
282 282  |(((
283 283  (% class="western" %)
284 -GET
498 +**Method**
285 285  )))|(((
286 286  (% class="western" %)
287 -/users/lookup?1=user1@[[email.com>>url:http://email.com||shape="rect"]]&return=1,2
501 +**Url**
288 288  )))|(((
289 289  (% class="western" %)
290 -Lookup for user whose question id (1) is equal to supplied value. The users object returned will have value of questions 1 & 2. Here for example assumed to be firstname and last name.
291 -
292 -(% class="western" %)
293 -Return parameter defines a csv of question id that are requested back in response.
504 +**Action**
294 294  )))
295 295  |(((
296 296  (% class="western" %)
297 -POST
508 +GET
298 298  )))|(((
299 299  (% class="western" %)
300 -/users
511 +/questions
301 301  )))|(((
302 302  (% class="western" %)
303 -Create a new users
304 -
305 -(% class="western" %)
306 -Parameters required to create the user needs to be sent as post data in JSON format.
514 +List all questions
307 307  )))
308 308  |(((
309 309  (% class="western" %)
310 -PUT
518 +GET
311 311  )))|(((
312 312  (% class="western" %)
313 -/users/1
521 +/questions/1
314 314  )))|(((
315 315  (% class="western" %)
316 -Update user id 1. The user id can be a numeric value or a hash
317 -
318 -(% class="western" %)
319 -Parameters required to update the user needs to be sent as post data in JSON format.
524 +Returns question id 1
320 320  )))
321 321  |(((
322 322  (% class="western" %)
... ... @@ -323,10 +323,10 @@
323 323  GET
324 324  )))|(((
325 325  (% class="western" %)
326 -/users/1/partners/2
531 +/questions/lookup?Text=Email
327 327  )))|(((
328 328  (% class="western" %)
329 -Get user id 1 and partner id 2's ONEcount hash. The user id can be a numeric value or a hash.
534 +Returns all questions with “Email" in question text
330 330  )))
331 331  |(((
332 332  (% class="western" %)
... ... @@ -333,41 +333,34 @@
333 333  POST
334 334  )))|(((
335 335  (% class="western" %)
336 -/users/login
541 +/questions
337 337  )))|(((
338 338  (% class="western" %)
339 -Check to see user exist with username/email and password.
544 +Create a new question
340 340  
341 341  (% class="western" %)
342 -Parameters required to create JSON object with **u** as username, **e** as email and **p** as password and sent is as POST param.
343 -
547 +JSON of the Questions type object needs to be sent as post data. Id field should not be sent.
548 +)))
549 +|(((
344 344  (% class="western" %)
345 -Example:
346 -
551 +PUT
552 +)))|(((
347 347  (% class="western" %)
348 -{"u":"[[abc@one-count.com>>mailto:abc@one-count.com||shape="rect" class="western"]]","e":"abc@[[one-count.com>>url:http://one-count.com||shape="rect"]]","p":"1234"}
349 -
554 +/questions
555 +)))|(((
350 350  (% class="western" %)
351 -OR
557 +Update a question
352 352  
353 353  (% class="western" %)
354 -{"u":"[[abc@one-count.com>>mailto:abc@one-count.com||shape="rect" class="western"]]","p":"1234"}
355 -
356 -(% class="western" %)
357 -OR
358 -
359 -(% class="western" %)
360 -{"e":"[[abc@one-count.com>>mailto:abc@one-count.com||shape="rect" class="western"]]","p":"1234"}
361 -
362 -(% class="western" %)
363 -**OUTPUT** : Should get ocid of the user if it finds it otherwise get and error with msg user not found.
560 +JSON of the Questions type object needs to be sent as post data. Id field is mandatory for update.
364 364  )))
365 365  
366 366  
367 367  
368 368  (% class="western" %)
369 -**GET method should be used to lookup users.**
566 +**GET method can be used to lookup questions.**
370 370  
568 +(% class="wrapped" %)
371 371  |(((
372 372  (% class="western" %)
373 373  **Request**
... ... @@ -386,19 +386,19 @@
386 386  String
387 387  )))|(((
388 388  (% class="western" %)
389 -URL encoded key value string parameters for the lookup. Return property has csv of questions id requested back in Users object.
587 +URL encoded key value string parameters for the question that a user is trying to search.
390 390  
391 391  (% class="western" %)
392 -Params: Value of question Ids: Key value for Lookup question ids for e.g. 1=user1@[[email.com>>url:http://email.com||shape="rect"]]
590 +Params:
393 393  
394 394  (% class="western" %)
395 -return: csv of question id that is requested back. The Users object returned will only have these properties plus UserId (String)
593 +Text: Word or phrase that should be present in the question text (String)
594 +
595 +(% class="western" %)
596 +Type: Look up the question type.
396 396  )))
397 397  
398 -
399 -
400 -
401 -
599 +(% class="wrapped" %)
402 402  |(((
403 403  (% class="western" %)
404 404  **Response**
... ... @@ -411,20 +411,21 @@
411 411  )))
412 412  |(((
413 413  (% class="western" %)
414 -Users
415 -)))|=(((
416 -(% class="western" align="left" %)
417 -Users
612 +Questions
418 418  )))|(((
419 419  (% class="western" %)
420 -Found users returned with the demo field requested in return parameter in json format.
615 +Questions
616 +)))|(((
617 +(% class="western" %)
618 +Returns found question details.
421 421  )))
422 422  
423 423  
424 424  
425 425  (% class="western" %)
426 -**POST method should be used to create users.**
624 +**POST method should be used to create questions. The data that is sent should be in JSON format and of type questions as described in references section. Questions object will only need a choices block if the question is a multiple choice question (type=4 or 5 or 6).**
427 427  
626 +(% class="wrapped" %)
428 428  |(((
429 429  (% class="western" %)
430 430  **Request**
... ... @@ -437,48 +437,46 @@
437 437  )))
438 438  |(((
439 439  (% class="western" %)
440 -Users
639 +Questions
441 441  )))|(((
442 442  (% class="western" %)
443 -Users
642 +Questions
444 444  )))|(((
445 445  (% class="western" %)
446 -Users object that contains information about user to create. PartnerId Needs to be specified.
645 +This defines the question contents and possible responses.
447 447  )))
647 +
648 +(% class="wrapped" %)
448 448  |(((
449 449  (% class="western" %)
450 -Transactions
651 +**Response**
451 451  )))|(((
452 452  (% class="western" %)
453 -Transactions
654 +**Type**
454 454  )))|(((
455 455  (% class="western" %)
456 -(Array of) transaction object specifying parts of the transaction to be added to the new user. UserId and TransactionId, SubscriptionType will be ignored if specified. As this is new user and new transaction is being added.
657 +**Description**
457 457  )))
458 458  |(((
459 459  (% class="western" %)
460 -DedupeColumns
661 +QuestionId
461 461  )))|(((
462 462  (% class="western" %)
463 -String
664 +Int
464 464  )))|(((
465 465  (% class="western" %)
466 -CSV of question id's that should be considered to find duplicate.
667 +Returns ONEcount question id on successful creation of the question.
467 467  )))
468 -|(((
669 +
670 +
671 +
469 469  (% class="western" %)
470 -Return
471 -)))|(((
472 -(% class="western" %)
473 -String
474 -)))|(((
475 -(% class="western" %)
476 -CSV of ONEcount QuestionId's requested back in Users object in response.
477 -)))
673 +PUT method should be used to update question.
478 478  
675 +(% class="wrapped" %)
479 479  |(((
480 480  (% class="western" %)
481 -**Response**
678 +**Request**
482 482  )))|(((
483 483  (% class="western" %)
484 484  **Type**
... ... @@ -488,23 +488,19 @@
488 488  )))
489 489  |(((
490 490  (% class="western" %)
491 -Users
492 -)))|=(((
493 -(% class="western" align="left" %)
494 -Users
688 +Questions
495 495  )))|(((
496 496  (% class="western" %)
497 -Created users returned with the demo field requested in return parameter in json format. If return was not specified only UserId will be returned.
691 +Questions
692 +)))|(((
693 +(% class="western" %)
694 +This defines the question contents and responses.
498 498  )))
499 499  
500 -
501 -
502 -(% class="western" %)
503 -**PUT method should be used to update users.**
504 -
697 +(% class="wrapped" %)
505 505  |(((
506 506  (% class="western" %)
507 -**Request**
700 +**Response**
508 508  )))|(((
509 509  (% class="western" %)
510 510  **Type**
... ... @@ -514,173 +514,168 @@
514 514  )))
515 515  |(((
516 516  (% class="western" %)
517 -Users
710 +QuestionId
518 518  )))|(((
519 519  (% class="western" %)
520 -Users
713 +Int
521 521  )))|(((
522 522  (% class="western" %)
523 -Users object with update fields. Return property has csv of questions id requested back in Users object.
716 +Returns ONEcount question id on successful update of the question.
524 524  )))
525 -|(((
718 +
526 526  (% class="western" %)
527 -Return
528 -)))|(((
720 +
721 +
529 529  (% class="western" %)
530 -String
531 -)))|(((
723 +Example: Get list of questions from api which has FirstName in text
724 +
725 +{{{curl -X GET -H “Appkey: xxx” https://api.onecount.net/v2/questions/lookup?Text=FirstName}}}
726 +
532 532  (% class="western" %)
533 -CSV of ONEcount QuestionId's requested back in Users object in response
534 -)))
535 -|(((
728 +{
729 +
536 536  (% class="western" %)
537 -RequestDate
538 -)))|(((
731 +"result": {
732 +
539 539  (% class="western" %)
540 -Date
541 -)))|(((
734 +"success": "1",
735 +
542 542  (% class="western" %)
543 -RequestDate to use for the demo update. If not provided current date will be used.
544 -)))
737 +"error": {
545 545  
546 -|(((
547 547  (% class="western" %)
548 -**Response**
549 -)))|(((
740 +"code": "0",
741 +
550 550  (% class="western" %)
551 -**Type**
552 -)))|(((
743 +"message": ""
744 +
553 553  (% class="western" %)
554 -**Description**
555 -)))
556 -|(((
746 +}
747 +
557 557  (% class="western" %)
558 -Users
559 -)))|=(((
560 -(% class="western" align="left" %)
561 -Users
562 -)))|(((
749 +},
750 +
563 563  (% class="western" %)
564 -Updated user returned with the demo field requested in return parameter in json format.
565 -)))
752 +"Questions": [
566 566  
567 567  (% class="western" %)
568 -
755 +{
569 569  
570 570  (% class="western" %)
571 -
758 +"Id": "6",
572 572  
573 573  (% class="western" %)
574 -Create new users. Here in this example the JSON for request is passed in userFile.json file.
761 +"Text": "FirstName",
575 575  
576 -{{{curl -X POST -H “Appkey: xxx” -H "Content-Type: application/json" –data-binary -d '@userFile.json' https://api.onecount.net/v2/users}}}
763 +(% class="western" %)
764 +"Type": "1",
577 577  
578 578  (% class="western" %)
579 -**
580 -**
767 +"Alias": "FName"
581 581  
582 582  (% class="western" %)
583 -**
584 -**
770 +}
585 585  
586 -
772 +(% class="western" %)
773 +]
587 587  
588 588  (% class="western" %)
589 -**COMPONENT: Questions**
776 +}
590 590  
591 591  (% class="western" %)
592 -All data fields in ONEcount are made up of questions. Questions are configurable on a per-client basis, and no two customer installations will have the same question (ie., field) layout. Therefore, before querying or updating any ONEcount installation, you'll need to get an understanding of the question layout of the installation. This API segment will allow you to query ONEcount to determine the question layout for the installation. It will also allow you to create new questions within the system. This resource does not allow you to update the data for a specific user (see User section).
593 593  
780 +**Users**
781 +
594 594  (% class="western" %)
595 -This resource is for manipulating questions resource. Questions in ONEcount means any question that is asked to the subscriber. It could be any questions that appears on customer forms or print forms that gets answered by a subscriber. Questions api call will allow creation, update and search of question in ONEcount. To add a new questions to the system you'll make a POST api call to the questions resource.
783 +Users means the customers of your system. Users can be added, updated and searched for using the users resource from the api. For lookup, If a return parameter is specified Users object will have those fields. If nothing is specified by default only UserId is returned.
596 596  
597 597  (% class="western" %)
598 -The data that is sent should be in JSON format and of type questions as described in References section. The type property of questions object is described below. Questions object will only need a choices block if the question is a multiple choice question(type=4 or 5 or 6)
786 +Additionally (Array of) transaction object specifying parts of the transaction to be added to the new user can be specified. UserId, TransactionId and SubscriptionType will be ignored if specified for this case. As this is new user and new transaction is being added.
599 599  
600 600  (% class="western" %)
601 -There can be 6 types of questions:
789 +In this case the provided demographic information in users object will be used to create a new user in ONEcount and then a response will be generated. Before creating a new user, a check for duplicate will be performed based on Dedupe columns and if found, and error code will be generated.
602 602  
791 +(% class="western" %)
792 +If username and password is not one of the parameters being passed, then a random username and password will be generated for the user while creating his user account in ONEcount.
793 +
794 +(% class="western" %)
795 +Return parameter will have the comma separated list of question Ids that is requested back from the API.
796 +
797 +(% class="western" %)
798 +Return is an optional parameter in request. If return is not requested then by default, only UserId (which is ONEcount ID) will be returned in the Users object.
799 +
800 +(% class="western" %)
801 +
802 +
603 603  (% class="wrapped" %)
604 604  |(((
605 -(% class="western" align="center" %)
606 -**Type**
607 -)))|(((
608 608  (% class="western" %)
609 -**Description**
610 -)))
611 -|(((
612 -(% class="western" align="center" %)
613 -1
806 +**Method**
614 614  )))|(((
615 615  (% class="western" %)
616 -Textbox type questions or short response type question. The response length needs to be less than 255 characters.
617 -)))
618 -|(((
619 -(% class="western" align="center" %)
620 -2
809 +**Url**
621 621  )))|(((
622 622  (% class="western" %)
623 -Textarea type question or long response type question.
812 +**Action**
624 624  )))
625 625  |(((
626 -(% class="western" align="center" %)
627 -3
815 +(% class="western" %)
816 +GET
628 628  )))|(((
629 629  (% class="western" %)
630 -Password type question. This is basically same as type 1 but when displayed in ONEcount frontend forms typed characters appears as *.
631 -)))
632 -|(((
633 -(% class="western" align="center" %)
634 -4
819 +/users
635 635  )))|(((
636 636  (% class="western" %)
637 -Select or dropdown type questions. This is a multiple choice, 1 response type question. When creating this type of question the choices block also needs to be part of the questions object that will hold the possible choices of the select question.
822 +Get users data limiting 25.
638 638  )))
639 639  |(((
640 -(% class="western" align="center" %)
641 -5
825 +(% class="western" %)
826 +GET
642 642  )))|(((
643 643  (% class="western" %)
644 -Radio button type question. This is a multiple choice, 1 response type question. When creating this type of question the choices block also needs to be part of the questions object that will hold the possible choices of the radio question.
645 -)))
646 -|(((
647 -(% class="western" align="center" %)
648 -6
829 +/users/1
649 649  )))|(((
650 650  (% class="western" %)
651 -Checkbox type question. This is a multiple choice, multi response type question. When creating this type of question the choices block also needs to be part of the questions object that will hold the possible choices of the checkbox question.
832 +Get data for user id 1. The user id can be a numeric value or a hash
652 652  )))
653 -
654 -(% class="wrapped" %)
655 655  |(((
656 656  (% class="western" %)
657 -**Method**
836 +GET
658 658  )))|(((
659 659  (% class="western" %)
660 -**Url**
839 +/users/lookup?1=user1@[[email.com>>url:http://email.com||shape="rect"]]&return=1,2
661 661  )))|(((
662 662  (% class="western" %)
663 -**Action**
842 +Lookup for user whose question id (1) is equal to supplied value. The users object returned will have value of questions 1 & 2. Here for example assumed to be firstname and last name.
843 +
844 +(% class="western" %)
845 +Return parameter defines a csv of question id that are requested back in response.
664 664  )))
665 665  |(((
666 666  (% class="western" %)
667 -GET
849 +POST
668 668  )))|(((
669 669  (% class="western" %)
670 -/questions
852 +/users
671 671  )))|(((
672 672  (% class="western" %)
673 -List all questions
855 +Create a new users
856 +
857 +(% class="western" %)
858 +Parameters required to create the user needs to be sent as post data in JSON format.
674 674  )))
675 675  |(((
676 676  (% class="western" %)
677 -GET
862 +PUT
678 678  )))|(((
679 679  (% class="western" %)
680 -/questions/1
865 +/users/1
681 681  )))|(((
682 682  (% class="western" %)
683 -Returns question id 1
868 +Update user id 1. The user id can be a numeric value or a hash
869 +
870 +(% class="western" %)
871 +Parameters required to update the user needs to be sent as post data in JSON format.
684 684  )))
685 685  |(((
686 686  (% class="western" %)
... ... @@ -687,10 +687,10 @@
687 687  GET
688 688  )))|(((
689 689  (% class="western" %)
690 -/questions/lookup?Text=Email
878 +/users/1/partners/2
691 691  )))|(((
692 692  (% class="western" %)
693 -Returns all questions with “Email" in question text
881 +Get user id 1 and partner id 2's ONEcount hash. The user id can be a numeric value or a hash.
694 694  )))
695 695  |(((
696 696  (% class="western" %)
... ... @@ -697,32 +697,40 @@
697 697  POST
698 698  )))|(((
699 699  (% class="western" %)
700 -/questions
888 +/users/login
701 701  )))|(((
702 702  (% class="western" %)
703 -Create a new question
891 +Check to see user exist with username/email and password.
704 704  
705 705  (% class="western" %)
706 -JSON of the Questions type object needs to be sent as post data. Id field should not be sent.
707 -)))
708 -|(((
894 +Parameters required to create JSON object with **u** as username, **e** as email and **p** as password and sent is as POST param.
895 +
709 709  (% class="western" %)
710 -PUT
711 -)))|(((
897 +Example:
898 +
712 712  (% class="western" %)
713 -/questions
714 -)))|(((
900 +{"u":"[[abc@one-count.com>>mailto:abc@one-count.com||shape="rect" class="western"]]","e":"abc@[[one-count.com>>url:http://one-count.com||shape="rect"]]","p":"1234"}
901 +
715 715  (% class="western" %)
716 -Update a question
903 +OR
717 717  
718 718  (% class="western" %)
719 -JSON of the Questions type object needs to be sent as post data. Id field is mandatory for update.
906 +{"u":"[[abc@one-count.com>>mailto:abc@one-count.com||shape="rect" class="western"]]","p":"1234"}
907 +
908 +(% class="western" %)
909 +OR
910 +
911 +(% class="western" %)
912 +{"e":"[[abc@one-count.com>>mailto:abc@one-count.com||shape="rect" class="western"]]","p":"1234"}
913 +
914 +(% class="western" %)
915 +**OUTPUT** : Should get ocid of the user if it finds it otherwise get and error with msg user not found.
720 720  )))
721 721  
722 722  
723 723  
724 724  (% class="western" %)
725 -**GET method can be used to lookup questions.**
921 +**GET method should be used to lookup users.**
726 726  
727 727  (% class="wrapped" %)
728 728  |(((
... ... @@ -743,18 +743,19 @@
743 743  String
744 744  )))|(((
745 745  (% class="western" %)
746 -URL encoded key value string parameters for the question that a user is trying to search.
942 +URL encoded key value string parameters for the lookup. Return property has csv of questions id requested back in Users object.
747 747  
748 748  (% class="western" %)
749 -Params:
945 +Params: Value of question Ids: Key value for Lookup question ids for e.g. 1=user1@[[email.com>>url:http://email.com||shape="rect"]]
750 750  
751 751  (% class="western" %)
752 -Text: Word or phrase that should be present in the question text (String)
753 -
754 -(% class="western" %)
755 -Type: Look up the question type.
948 +return: csv of question id that is requested back. The Users object returned will only have these properties plus UserId (String)
756 756  )))
757 757  
951 +
952 +
953 +
954 +
758 758  (% class="wrapped" %)
759 759  |(((
760 760  (% class="western" %)
... ... @@ -768,19 +768,19 @@
768 768  )))
769 769  |(((
770 770  (% class="western" %)
771 -Questions
968 +Users
969 +)))|=(((
970 +(% class="western" align="left" %)
971 +Users
772 772  )))|(((
773 773  (% class="western" %)
774 -Questions
775 -)))|(((
776 -(% class="western" %)
777 -Returns found question details.
974 +Found users returned with the demo field requested in return parameter in json format.
778 778  )))
779 779  
780 780  
781 781  
782 782  (% class="western" %)
783 -**POST method should be used to create questions. The data that is sent should be in JSON format and of type questions as described in references section. Questions object will only need a choices block if the question is a multiple choice question (type=4 or 5 or 6).**
980 +**POST method should be used to create users.**
784 784  
785 785  (% class="wrapped" %)
786 786  |(((
... ... @@ -795,46 +795,49 @@
795 795  )))
796 796  |(((
797 797  (% class="western" %)
798 -Questions
995 +Users
799 799  )))|(((
800 800  (% class="western" %)
801 -Questions
998 +Users
802 802  )))|(((
803 803  (% class="western" %)
804 -This defines the question contents and possible responses.
1001 +Users object that contains information about user to create. PartnerId Needs to be specified.
805 805  )))
806 -
807 -(% class="wrapped" %)
808 808  |(((
809 809  (% class="western" %)
810 -**Response**
1005 +Transactions
811 811  )))|(((
812 812  (% class="western" %)
813 -**Type**
1008 +Transactions
814 814  )))|(((
815 815  (% class="western" %)
816 -**Description**
1011 +(Array of) transaction object specifying parts of the transaction to be added to the new user. UserId and TransactionId, SubscriptionType will be ignored if specified. As this is new user and new transaction is being added.
817 817  )))
818 818  |(((
819 819  (% class="western" %)
820 -QuestionId
1015 +DedupeColumns
821 821  )))|(((
822 822  (% class="western" %)
823 -Int
1018 +String
824 824  )))|(((
825 825  (% class="western" %)
826 -Returns ONEcount question id on successful creation of the question.
1021 +CSV of question id's that should be considered to find duplicate.
827 827  )))
828 -
829 -
830 -
1023 +|(((
831 831  (% class="western" %)
832 -PUT method should be used to update question.
1025 +Return
1026 +)))|(((
1027 +(% class="western" %)
1028 +String
1029 +)))|(((
1030 +(% class="western" %)
1031 +CSV of ONEcount QuestionId's requested back in Users object in response.
1032 +)))
833 833  
834 834  (% class="wrapped" %)
835 835  |(((
836 836  (% class="western" %)
837 -**Request**
1037 +**Response**
838 838  )))|(((
839 839  (% class="western" %)
840 840  **Type**
... ... @@ -844,19 +844,24 @@
844 844  )))
845 845  |(((
846 846  (% class="western" %)
847 -Questions
1047 +Users
1048 +)))|=(((
1049 +(% class="western" align="left" %)
1050 +Users
848 848  )))|(((
849 849  (% class="western" %)
850 -Questions
851 -)))|(((
852 -(% class="western" %)
853 -This defines the question contents and responses.
1053 +Created users returned with the demo field requested in return parameter in json format. If return was not specified only UserId will be returned.
854 854  )))
855 855  
1056 +
1057 +
1058 +(% class="western" %)
1059 +**PUT method should be used to update users.**
1060 +
856 856  (% class="wrapped" %)
857 857  |(((
858 858  (% class="western" %)
859 -**Response**
1064 +**Request**
860 860  )))|(((
861 861  (% class="western" %)
862 862  **Type**
... ... @@ -866,81 +866,72 @@
866 866  )))
867 867  |(((
868 868  (% class="western" %)
869 -QuestionId
1074 +Users
870 870  )))|(((
871 871  (% class="western" %)
872 -Int
1077 +Users
873 873  )))|(((
874 874  (% class="western" %)
875 -Returns ONEcount question id on successful update of the question.
1080 +Users object with update fields. Return property has csv of questions id requested back in Users object.
876 876  )))
877 -
1082 +|(((
878 878  (% class="western" %)
879 -
880 -
1084 +Return
1085 +)))|(((
881 881  (% class="western" %)
882 -Example: Get list of questions from api which has FirstName in text
883 -
884 -{{{curl -X GET -H “Appkey: xxx” https://api.onecount.net/v2/questions/lookup?Text=FirstName}}}
885 -
1087 +String
1088 +)))|(((
886 886  (% class="western" %)
887 -{
888 -
1090 +CSV of ONEcount QuestionId's requested back in Users object in response
1091 +)))
1092 +|(((
889 889  (% class="western" %)
890 -"result": {
891 -
1094 +RequestDate
1095 +)))|(((
892 892  (% class="western" %)
893 -"success": "1",
894 -
1097 +Date
1098 +)))|(((
895 895  (% class="western" %)
896 -"error": {
1100 +RequestDate to use for the demo update. If not provided current date will be used.
1101 +)))
897 897  
1103 +(% class="wrapped" %)
1104 +|(((
898 898  (% class="western" %)
899 -"code": "0",
900 -
1106 +**Response**
1107 +)))|(((
901 901  (% class="western" %)
902 -"message": ""
903 -
1109 +**Type**
1110 +)))|(((
904 904  (% class="western" %)
905 -}
906 -
1112 +**Description**
1113 +)))
1114 +|(((
907 907  (% class="western" %)
908 -},
909 -
1116 +Users
1117 +)))|=(((
1118 +(% class="western" align="left" %)
1119 +Users
1120 +)))|(((
910 910  (% class="western" %)
911 -"Questions": [
1122 +Updated user returned with the demo field requested in return parameter in json format.
1123 +)))
912 912  
913 913  (% class="western" %)
914 -{
1126 +
915 915  
916 916  (% class="western" %)
917 -"Id": "6",
1129 +
918 918  
919 919  (% class="western" %)
920 -"Text": "FirstName",
1132 +Create new users. Here in this example the JSON for request is passed in userFile.json file.
921 921  
922 -(% class="western" %)
923 -"Type": "1",
1134 +{{{curl -X POST -H “Appkey: xxx” -H "Content-Type: application/json" –data-binary -d '@userFile.json' https://api.onecount.net/v2/users}}}
924 924  
925 925  (% class="western" %)
926 -"Alias": "FName"
1137 +**Products**
927 927  
928 928  (% class="western" %)
929 -}
930 -
931 -(% class="western" %)
932 -]
933 -
934 -(% class="western" %)
935 -}
936 -
937 -(% class="western" %)
938 -\\
939 -
940 -(% class="western" %)
941 -**COMPONENT: Products**
942 -
943 -(% class="western" %)
944 944  This resource is for manipulating products resource. A product can be created, updated or searched.
945 945  
946 946  (% class="wrapped" %)
... ... @@ -1195,7 +1195,7 @@
1195 1195  
1196 1196  
1197 1197  (% class="western" %)
1198 -**COMPONENT: Terms**
1394 +**Terms**
1199 1199  
1200 1200  (% class="western" %)
1201 1201  This resource is for manipulating terms resource. A term can be created, updated or searched.
... ... @@ -1426,45 +1426,9 @@
1426 1426  
1427 1427  
1428 1428  (% class="western" %)
1429 -**COMPONENT: Resources**
1625 +**Resources**
1430 1430  
1431 1431  (% class="western" %)
1432 -Resources are the available entities that can be accessed/modified via API. Each resource can be created, updated or requested by using the corresponding http method described above.
1433 -
1434 -* (((
1435 -(% class="western" %)
1436 -questions
1437 -)))
1438 -* (((
1439 -(% class="western" %)
1440 -users
1441 -)))
1442 -* (((
1443 -(% class="western" %)
1444 -products
1445 -)))
1446 -* (((
1447 -(% class="western" %)
1448 -terms
1449 -)))
1450 -* (((
1451 -(% class="western" %)
1452 -resources
1453 -)))
1454 -* (((
1455 -(% class="western" %)
1456 -sources
1457 -)))
1458 -* (((
1459 -(% class="western" %)
1460 -transactions
1461 -)))
1462 -
1463 -(% class="western" %)
1464 -**
1465 -**
1466 -
1467 -(% class="western" %)
1468 1468  This resource is for manipulating resources resource. A resource can be created, updated or searched.
1469 1469  
1470 1470  (% class="wrapped" %)
... ... @@ -1522,7 +1522,7 @@
1522 1522  
1523 1523  
1524 1524  (% class="western" %)
1525 -**GET method should be used to lookup resources.**
1685 +**GET method should be used to lookup products.**
1526 1526  
1527 1527  (% class="wrapped" %)
1528 1528  |(((
... ... @@ -1577,7 +1577,7 @@
1577 1577  
1578 1578  
1579 1579  (% class="western" %)
1580 -**POST method should be used to create resources.**
1740 +**POST method should be used to create products.**
1581 1581  
1582 1582  (% class="wrapped" %)
1583 1583  |(((
... ... @@ -1692,6 +1692,7 @@
1692 1692  
1693 1693  
1694 1694  
1855 +(% class="western" %)
1695 1695  
1696 1696  
1697 1697  (% class="western" %)
... ... @@ -1698,11 +1698,10 @@
1698 1698  
1699 1699  
1700 1700  (% class="western" %)
1701 -**COMPONENT: Source Codes
1702 -**
1862 +**Sources**
1703 1703  
1704 1704  (% class="western" %)
1705 -This resource is for manipulating source code for a resource. A source code can be created, updated or searched.
1865 +This resource is for manipulating sources resource. A source can be created, updated or searched.
1706 1706  
1707 1707  (% class="wrapped" %)
1708 1708  |(((
... ... @@ -1918,7 +1918,7 @@
1918 1918  
1919 1919  
1920 1920  (% class="western" %)
1921 -**COMPONENT: Transactions**
2081 +**Transactions**
1922 1922  
1923 1923  (% class="western" %)
1924 1924  This resource is for manipulating transactions resource. A transaction can be created or searched.
... ... @@ -2084,11 +2084,8 @@
2084 2084  
2085 2085  
2086 2086  
2087 -
2088 -
2089 2089  (% class="western" %)
2090 -**COMPONENT: Leads
2091 -**
2248 +**Stats**
2092 2092  
2093 2093  (% class="western" %)
2094 2094  Stats resource can be used to submit any type of stat collected on the third party systems. Each type of stat will be represented by a sub-resource. So, for telemarketing it could be **/stats/telemarketing** endpoint, for videos it can be **/stats/videos**, for webinar it could be **/stats/webinars** etc. Right now we only have telemarketing sub-resource.
... ... @@ -2109,8 +2109,7 @@
2109 2109  
2110 2110  
2111 2111  (% class="western" %)
2112 -**Telemarketing Leads
2113 -**
2269 +**Telemarketing**
2114 2114  
2115 2115  (% class="western" %)
2116 2116  
... ... @@ -2261,16 +2261,8 @@
2261 2261  
2262 2262  
2263 2263  
2264 -
2265 -
2266 -
2267 -
2268 -
2269 -
2270 -
2271 -
2272 2272  (% class="western" %)
2273 -**API REFERENCE**
2421 +**Reference**
2274 2274  
2275 2275  (% class="western" %)
2276 2276  **Type: Questions**
Confluence.Code.ConfluencePageClass[0]
id
... ... @@ -1,1 +1,1 @@
1 -3539010
1 +3539005
url
... ... @@ -1,1 +1,1 @@
1 -https://info.onecount.net//wiki/spaces/OD/pages/3539010/ONEcount API Documentation
1 +https://info.onecount.net//wiki/spaces/OD/pages/3539005/OC-API-04032017