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

From version 4.1
edited by sonish
on 2017/04/03 16:45
Change comment: There is no comment for this version
To version 10.1
edited by mikef
on 2017/04/12 18:28
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -OC-API-04032017
1 +ONEcount API Documentation
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.sonish
1 +XWiki.mikef
Content
... ... @@ -1,56 +49,8 @@
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 -
49 49  (% class="western" %)
50 50  **Introduction**
51 51  
52 52  (% class="western" %)
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.
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 update different ONEcount data components which are listed below.
54 54  
55 55  (% class="western" %)
56 56  REST takes advantage of the HTTP request methods to layer itself into the existing HTTP architecture. These operations consist of the following:
... ... @@ -58,14 +58,11 @@
58 58  1. (((
59 59  (% class="western" %)
60 60  **GET** - Used for lookup of resources
61 -
62 -* (((
13 +)))
63 63  1. (((
64 64  (% class="western" %)
65 65  **PUT** - Used to update a resource
66 66  )))
67 -)))
68 -)))
69 69  1. (((
70 70  (% class="western" %)
71 71  **POST** - Used to create a new resource
... ... @@ -72,178 +72,55 @@
72 72  )))
73 73  
74 74  (% class="western" %)
75 -ONEcount API provides following functionalities:
24 +Specifically, the ONEcount API provides to the following components:
76 76  
77 -1. (((
78 -(% class="western" %)
79 -**Lookup**
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 +\\\\\\
80 80  
81 -*
82 -
83 83  (% class="western" %)
84 -User lookup
60 +**Accessing API**
85 85  
86 -*
87 -
88 88  (% class="western" %)
89 -Transaction lookup
63 +**REST API URL**: [[https:~~/~~/api.onecount.net/v2/>>url:https://api.onecount.net/v2/||shape="rect"]]
90 90  
91 -*
92 -
93 93  (% class="western" %)
94 -Question lookup
66 +**Appkey**: THIS WILL BE PROVIDED TO YOU
95 95  
96 -*
97 -
98 98  (% class="western" %)
99 -Source code lookup
69 +**
70 +**
100 100  
101 -*
102 -
103 103  (% 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" %)
247 247  Your HTTP requests to a REST API resource should contain the following information:
248 248  
249 249  * (((
... ... @@ -264,9 +264,12 @@
264 264  )))
265 265  
266 266  (% class="western" %)
267 -**Request**
93 +
268 268  
269 269  (% class="western" %)
96 +**General API Usage**
97 +
98 +(% class="western" %)
270 270  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.
271 271  
272 272  (% class="western" %)
... ... @@ -395,133 +395,100 @@
395 395  
396 396  
397 397  (% class="western" %)
398 -**Resources**
227 +**
228 +**
399 399  
230 +**COMPONENT: Users**
231 +
400 400  (% class="western" %)
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.
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.
402 402  
403 -* (((
404 404  (% class="western" %)
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 -)))
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.
431 431  
432 432  (% class="western" %)
433 -**Questions**
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.
434 434  
435 435  (% class="western" %)
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.
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.
437 437  
438 438  (% class="western" %)
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)
245 +Return parameter will have the comma separated list of question Ids that is requested back from the API.
440 440  
441 441  (% class="western" %)
442 -There can be 6 types of questions:
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.
443 443  
250 +
251 +
444 444  (% class="wrapped" %)
445 445  |(((
446 -(% class="western" align="center" %)
447 -**Type**
448 -)))|(((
449 449  (% class="western" %)
450 -**Description**
451 -)))
452 -|(((
453 -(% class="western" align="center" %)
454 -1
255 +**Method**
455 455  )))|(((
456 456  (% class="western" %)
457 -Textbox type questions or short response type question. The response length needs to be less than 255 characters.
458 -)))
459 -|(((
460 -(% class="western" align="center" %)
461 -2
258 +**Url**
462 462  )))|(((
463 463  (% class="western" %)
464 -Textarea type question or long response type question.
261 +**Action**
465 465  )))
466 466  |(((
467 -(% class="western" align="center" %)
468 -3
264 +(% class="western" %)
265 +GET
469 469  )))|(((
470 470  (% class="western" %)
471 -Password type question. This is basically same as type 1 but when displayed in ONEcount frontend forms typed characters appears as *.
472 -)))
473 -|(((
474 -(% class="western" align="center" %)
475 -4
268 +/users
476 476  )))|(((
477 477  (% class="western" %)
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.
271 +Get users data limiting 25.
479 479  )))
480 480  |(((
481 -(% class="western" align="center" %)
482 -5
274 +(% class="western" %)
275 +GET
483 483  )))|(((
484 484  (% class="western" %)
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 +/users/1
490 490  )))|(((
491 491  (% class="western" %)
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 +Get data for user id 1. The user id can be a numeric value or a hash
493 493  )))
494 -
495 -(% class="wrapped" %)
496 496  |(((
497 497  (% class="western" %)
498 -**Method**
285 +GET
499 499  )))|(((
500 500  (% class="western" %)
501 -**Url**
288 +/users/lookup?1=user1@[[email.com>>url:http://email.com||shape="rect"]]&return=1,2
502 502  )))|(((
503 503  (% class="western" %)
504 -**Action**
291 +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.
292 +
293 +(% class="western" %)
294 +Return parameter defines a csv of question id that are requested back in response.
505 505  )))
506 506  |(((
507 507  (% class="western" %)
508 -GET
298 +POST
509 509  )))|(((
510 510  (% class="western" %)
511 -/questions
301 +/users
512 512  )))|(((
513 513  (% class="western" %)
514 -List all questions
304 +Create a new users
305 +
306 +(% class="western" %)
307 +Parameters required to create the user needs to be sent as post data in JSON format.
515 515  )))
516 516  |(((
517 517  (% class="western" %)
518 -GET
311 +PUT
519 519  )))|(((
520 520  (% class="western" %)
521 -/questions/1
314 +/users/1
522 522  )))|(((
523 523  (% class="western" %)
524 -Returns question id 1
317 +Update user id 1. The user id can be a numeric value or a hash
318 +
319 +(% class="western" %)
320 +Parameters required to update the user needs to be sent as post data in JSON format.
525 525  )))
526 526  |(((
527 527  (% class="western" %)
... ... @@ -528,10 +528,10 @@
528 528  GET
529 529  )))|(((
530 530  (% class="western" %)
531 -/questions/lookup?Text=Email
327 +/users/1/partners/2
532 532  )))|(((
533 533  (% class="western" %)
534 -Returns all questions with “Email" in question text
330 +Get user id 1 and partner id 2's ONEcount hash. The user id can be a numeric value or a hash.
535 535  )))
536 536  |(((
537 537  (% class="western" %)
... ... @@ -538,32 +538,40 @@
538 538  POST
539 539  )))|(((
540 540  (% class="western" %)
541 -/questions
337 +/users/login
542 542  )))|(((
543 543  (% class="western" %)
544 -Create a new question
340 +Check to see user exist with username/email and password.
545 545  
546 546  (% class="western" %)
547 -JSON of the Questions type object needs to be sent as post data. Id field should not be sent.
548 -)))
549 -|(((
343 +Parameters required to create JSON object with **u** as username, **e** as email and **p** as password and sent is as POST param.
344 +
550 550  (% class="western" %)
551 -PUT
552 -)))|(((
346 +Example:
347 +
553 553  (% class="western" %)
554 -/questions
555 -)))|(((
349 +{"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"}
350 +
556 556  (% class="western" %)
557 -Update a question
352 +OR
558 558  
559 559  (% class="western" %)
560 -JSON of the Questions type object needs to be sent as post data. Id field is mandatory for update.
355 +{"u":"[[abc@one-count.com>>mailto:abc@one-count.com||shape="rect" class="western"]]","p":"1234"}
356 +
357 +(% class="western" %)
358 +OR
359 +
360 +(% class="western" %)
361 +{"e":"[[abc@one-count.com>>mailto:abc@one-count.com||shape="rect" class="western"]]","p":"1234"}
362 +
363 +(% class="western" %)
364 +**OUTPUT** : Should get ocid of the user if it finds it otherwise get and error with msg user not found.
561 561  )))
562 562  
563 563  
564 564  
565 565  (% class="western" %)
566 -**GET method can be used to lookup questions.**
370 +**GET method should be used to lookup users.**
567 567  
568 568  (% class="wrapped" %)
569 569  |(((
... ... @@ -584,18 +584,19 @@
584 584  String
585 585  )))|(((
586 586  (% class="western" %)
587 -URL encoded key value string parameters for the question that a user is trying to search.
391 +URL encoded key value string parameters for the lookup. Return property has csv of questions id requested back in Users object.
588 588  
589 589  (% class="western" %)
590 -Params:
394 +Params: Value of question Ids: Key value for Lookup question ids for e.g. 1=user1@[[email.com>>url:http://email.com||shape="rect"]]
591 591  
592 592  (% class="western" %)
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.
397 +return: csv of question id that is requested back. The Users object returned will only have these properties plus UserId (String)
597 597  )))
598 598  
400 +
401 +
402 +
403 +
599 599  (% class="wrapped" %)
600 600  |(((
601 601  (% class="western" %)
... ... @@ -609,19 +609,19 @@
609 609  )))
610 610  |(((
611 611  (% class="western" %)
612 -Questions
417 +Users
418 +)))|=(((
419 +(% class="western" align="left" %)
420 +Users
613 613  )))|(((
614 614  (% class="western" %)
615 -Questions
616 -)))|(((
617 -(% class="western" %)
618 -Returns found question details.
423 +Found users returned with the demo field requested in return parameter in json format.
619 619  )))
620 620  
621 621  
622 622  
623 623  (% class="western" %)
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).**
429 +**POST method should be used to create users.**
625 625  
626 626  (% class="wrapped" %)
627 627  |(((
... ... @@ -636,46 +636,49 @@
636 636  )))
637 637  |(((
638 638  (% class="western" %)
639 -Questions
444 +Users
640 640  )))|(((
641 641  (% class="western" %)
642 -Questions
447 +Users
643 643  )))|(((
644 644  (% class="western" %)
645 -This defines the question contents and possible responses.
450 +Users object that contains information about user to create. PartnerId Needs to be specified.
646 646  )))
647 -
648 -(% class="wrapped" %)
649 649  |(((
650 650  (% class="western" %)
651 -**Response**
454 +Transactions
652 652  )))|(((
653 653  (% class="western" %)
654 -**Type**
457 +Transactions
655 655  )))|(((
656 656  (% class="western" %)
657 -**Description**
460 +(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.
658 658  )))
659 659  |(((
660 660  (% class="western" %)
661 -QuestionId
464 +DedupeColumns
662 662  )))|(((
663 663  (% class="western" %)
664 -Int
467 +String
665 665  )))|(((
666 666  (% class="western" %)
667 -Returns ONEcount question id on successful creation of the question.
470 +CSV of question id's that should be considered to find duplicate.
668 668  )))
669 -
670 -
671 -
472 +|(((
672 672  (% class="western" %)
673 -PUT method should be used to update question.
474 +Return
475 +)))|(((
476 +(% class="western" %)
477 +String
478 +)))|(((
479 +(% class="western" %)
480 +CSV of ONEcount QuestionId's requested back in Users object in response.
481 +)))
674 674  
675 675  (% class="wrapped" %)
676 676  |(((
677 677  (% class="western" %)
678 -**Request**
486 +**Response**
679 679  )))|(((
680 680  (% class="western" %)
681 681  **Type**
... ... @@ -685,19 +685,24 @@
685 685  )))
686 686  |(((
687 687  (% class="western" %)
688 -Questions
496 +Users
497 +)))|=(((
498 +(% class="western" align="left" %)
499 +Users
689 689  )))|(((
690 690  (% class="western" %)
691 -Questions
692 -)))|(((
693 -(% class="western" %)
694 -This defines the question contents and responses.
502 +Created users returned with the demo field requested in return parameter in json format. If return was not specified only UserId will be returned.
695 695  )))
696 696  
505 +
506 +
507 +(% class="western" %)
508 +**PUT method should be used to update users.**
509 +
697 697  (% class="wrapped" %)
698 698  |(((
699 699  (% class="western" %)
700 -**Response**
513 +**Request**
701 701  )))|(((
702 702  (% class="western" %)
703 703  **Type**
... ... @@ -707,168 +707,174 @@
707 707  )))
708 708  |(((
709 709  (% class="western" %)
710 -QuestionId
523 +Users
711 711  )))|(((
712 712  (% class="western" %)
713 -Int
526 +Users
714 714  )))|(((
715 715  (% class="western" %)
716 -Returns ONEcount question id on successful update of the question.
529 +Users object with update fields. Return property has csv of questions id requested back in Users object.
717 717  )))
718 -
531 +|(((
719 719  (% class="western" %)
720 -
721 -
533 +Return
534 +)))|(((
722 722  (% class="western" %)
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 -
536 +String
537 +)))|(((
727 727  (% class="western" %)
728 -{
729 -
539 +CSV of ONEcount QuestionId's requested back in Users object in response
540 +)))
541 +|(((
730 730  (% class="western" %)
731 -"result": {
732 -
543 +RequestDate
544 +)))|(((
733 733  (% class="western" %)
734 -"success": "1",
735 -
546 +Date
547 +)))|(((
736 736  (% class="western" %)
737 -"error": {
549 +RequestDate to use for the demo update. If not provided current date will be used.
550 +)))
738 738  
552 +(% class="wrapped" %)
553 +|(((
739 739  (% class="western" %)
740 -"code": "0",
741 -
555 +**Response**
556 +)))|(((
742 742  (% class="western" %)
743 -"message": ""
744 -
558 +**Type**
559 +)))|(((
745 745  (% class="western" %)
746 -}
747 -
561 +**Description**
562 +)))
563 +|(((
748 748  (% class="western" %)
749 -},
750 -
565 +Users
566 +)))|=(((
567 +(% class="western" align="left" %)
568 +Users
569 +)))|(((
751 751  (% class="western" %)
752 -"Questions": [
571 +Updated user returned with the demo field requested in return parameter in json format.
572 +)))
753 753  
754 754  (% class="western" %)
755 -{
575 +
756 756  
757 757  (% class="western" %)
758 -"Id": "6",
578 +
759 759  
760 760  (% class="western" %)
761 -"Text": "FirstName",
581 +Create new users. Here in this example the JSON for request is passed in userFile.json file.
762 762  
763 -(% class="western" %)
764 -"Type": "1",
583 +{{{curl -X POST -H “Appkey: xxx” -H "Content-Type: application/json" –data-binary -d '@userFile.json' https://api.onecount.net/v2/users}}}
765 765  
766 766  (% class="western" %)
767 -"Alias": "FName"
586 +**
587 +**
768 768  
769 769  (% class="western" %)
770 -}
590 +**
591 +**
771 771  
772 -(% class="western" %)
773 -]
593 +
774 774  
775 775  (% class="western" %)
776 -}
596 +**COMPONENT: Questions**
777 777  
778 778  (% class="western" %)
599 +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).
779 779  
780 -**Users**
781 -
782 782  (% class="western" %)
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.
602 +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.
784 784  
785 785  (% class="western" %)
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.
605 +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)
787 787  
788 788  (% class="western" %)
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.
608 +There can be 6 types of questions:
790 790  
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 -
803 803  (% class="wrapped" %)
804 804  |(((
805 -(% class="western" %)
806 -**Method**
612 +(% class="western" align="center" %)
613 +**Type**
807 807  )))|(((
808 808  (% class="western" %)
809 -**Url**
616 +**Description**
617 +)))
618 +|(((
619 +(% class="western" align="center" %)
620 +1
810 810  )))|(((
811 811  (% class="western" %)
812 -**Action**
623 +Textbox type questions or short response type question. The response length needs to be less than 255 characters.
813 813  )))
814 814  |(((
815 -(% class="western" %)
816 -GET
626 +(% class="western" align="center" %)
627 +2
817 817  )))|(((
818 818  (% class="western" %)
819 -/users
630 +Textarea type question or long response type question.
631 +)))
632 +|(((
633 +(% class="western" align="center" %)
634 +3
820 820  )))|(((
821 821  (% class="western" %)
822 -Get users data limiting 25.
637 +Password type question. This is basically same as type 1 but when displayed in ONEcount frontend forms typed characters appears as *.
823 823  )))
824 824  |(((
640 +(% class="western" align="center" %)
641 +4
642 +)))|(((
825 825  (% class="western" %)
826 -GET
644 +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.
645 +)))
646 +|(((
647 +(% class="western" align="center" %)
648 +5
827 827  )))|(((
828 828  (% class="western" %)
829 -/users/1
651 +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.
652 +)))
653 +|(((
654 +(% class="western" align="center" %)
655 +6
830 830  )))|(((
831 831  (% class="western" %)
832 -Get data for user id 1. The user id can be a numeric value or a hash
658 +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.
833 833  )))
660 +
661 +(% class="wrapped" %)
834 834  |(((
835 835  (% class="western" %)
836 -GET
664 +**Method**
837 837  )))|(((
838 838  (% class="western" %)
839 -/users/lookup?1=user1@[[email.com>>url:http://email.com||shape="rect"]]&return=1,2
667 +**Url**
840 840  )))|(((
841 841  (% class="western" %)
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.
670 +**Action**
846 846  )))
847 847  |(((
848 848  (% class="western" %)
849 -POST
674 +GET
850 850  )))|(((
851 851  (% class="western" %)
852 -/users
677 +/questions
853 853  )))|(((
854 854  (% class="western" %)
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.
680 +List all questions
859 859  )))
860 860  |(((
861 861  (% class="western" %)
862 -PUT
684 +GET
863 863  )))|(((
864 864  (% class="western" %)
865 -/users/1
687 +/questions/1
866 866  )))|(((
867 867  (% class="western" %)
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.
690 +Returns question id 1
872 872  )))
873 873  |(((
874 874  (% class="western" %)
... ... @@ -875,10 +875,10 @@
875 875  GET
876 876  )))|(((
877 877  (% class="western" %)
878 -/users/1/partners/2
697 +/questions/lookup?Text=Email
879 879  )))|(((
880 880  (% class="western" %)
881 -Get user id 1 and partner id 2's ONEcount hash. The user id can be a numeric value or a hash.
700 +Returns all questions with “Email" in question text
882 882  )))
883 883  |(((
884 884  (% class="western" %)
... ... @@ -885,40 +885,32 @@
885 885  POST
886 886  )))|(((
887 887  (% class="western" %)
888 -/users/login
707 +/questions
889 889  )))|(((
890 890  (% class="western" %)
891 -Check to see user exist with username/email and password.
710 +Create a new question
892 892  
893 893  (% class="western" %)
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 -
713 +JSON of the Questions type object needs to be sent as post data. Id field should not be sent.
714 +)))
715 +|(((
896 896  (% class="western" %)
897 -Example:
898 -
717 +PUT
718 +)))|(((
899 899  (% class="western" %)
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 -
720 +/questions
721 +)))|(((
902 902  (% class="western" %)
903 -OR
723 +Update a question
904 904  
905 905  (% class="western" %)
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.
726 +JSON of the Questions type object needs to be sent as post data. Id field is mandatory for update.
916 916  )))
917 917  
918 918  
919 919  
920 920  (% class="western" %)
921 -**GET method should be used to lookup users.**
732 +**GET method can be used to lookup questions.**
922 922  
923 923  (% class="wrapped" %)
924 924  |(((
... ... @@ -939,19 +939,18 @@
939 939  String
940 940  )))|(((
941 941  (% class="western" %)
942 -URL encoded key value string parameters for the lookup. Return property has csv of questions id requested back in Users object.
753 +URL encoded key value string parameters for the question that a user is trying to search.
943 943  
944 944  (% class="western" %)
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"]]
756 +Params:
946 946  
947 947  (% class="western" %)
948 -return: csv of question id that is requested back. The Users object returned will only have these properties plus UserId (String)
759 +Text: Word or phrase that should be present in the question text (String)
760 +
761 +(% class="western" %)
762 +Type: Look up the question type.
949 949  )))
950 950  
951 -
952 -
953 -
954 -
955 955  (% class="wrapped" %)
956 956  |(((
957 957  (% class="western" %)
... ... @@ -965,19 +965,19 @@
965 965  )))
966 966  |(((
967 967  (% class="western" %)
968 -Users
969 -)))|=(((
970 -(% class="western" align="left" %)
971 -Users
778 +Questions
972 972  )))|(((
973 973  (% class="western" %)
974 -Found users returned with the demo field requested in return parameter in json format.
781 +Questions
782 +)))|(((
783 +(% class="western" %)
784 +Returns found question details.
975 975  )))
976 976  
977 977  
978 978  
979 979  (% class="western" %)
980 -**POST method should be used to create users.**
790 +**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).**
981 981  
982 982  (% class="wrapped" %)
983 983  |(((
... ... @@ -992,49 +992,46 @@
992 992  )))
993 993  |(((
994 994  (% class="western" %)
995 -Users
805 +Questions
996 996  )))|(((
997 997  (% class="western" %)
998 -Users
808 +Questions
999 999  )))|(((
1000 1000  (% class="western" %)
1001 -Users object that contains information about user to create. PartnerId Needs to be specified.
811 +This defines the question contents and possible responses.
1002 1002  )))
813 +
814 +(% class="wrapped" %)
1003 1003  |(((
1004 1004  (% class="western" %)
1005 -Transactions
817 +**Response**
1006 1006  )))|(((
1007 1007  (% class="western" %)
1008 -Transactions
820 +**Type**
1009 1009  )))|(((
1010 1010  (% class="western" %)
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.
823 +**Description**
1012 1012  )))
1013 1013  |(((
1014 1014  (% class="western" %)
1015 -DedupeColumns
827 +QuestionId
1016 1016  )))|(((
1017 1017  (% class="western" %)
1018 -String
830 +Int
1019 1019  )))|(((
1020 1020  (% class="western" %)
1021 -CSV of question id's that should be considered to find duplicate.
833 +Returns ONEcount question id on successful creation of the question.
1022 1022  )))
1023 -|(((
835 +
836 +
837 +
1024 1024  (% class="western" %)
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 -)))
839 +PUT method should be used to update question.
1033 1033  
1034 1034  (% class="wrapped" %)
1035 1035  |(((
1036 1036  (% class="western" %)
1037 -**Response**
844 +**Request**
1038 1038  )))|(((
1039 1039  (% class="western" %)
1040 1040  **Type**
... ... @@ -1044,24 +1044,19 @@
1044 1044  )))
1045 1045  |(((
1046 1046  (% class="western" %)
1047 -Users
1048 -)))|=(((
1049 -(% class="western" align="left" %)
1050 -Users
854 +Questions
1051 1051  )))|(((
1052 1052  (% class="western" %)
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.
857 +Questions
858 +)))|(((
859 +(% class="western" %)
860 +This defines the question contents and responses.
1054 1054  )))
1055 1055  
1056 -
1057 -
1058 -(% class="western" %)
1059 -**PUT method should be used to update users.**
1060 -
1061 1061  (% class="wrapped" %)
1062 1062  |(((
1063 1063  (% class="western" %)
1064 -**Request**
866 +**Response**
1065 1065  )))|(((
1066 1066  (% class="western" %)
1067 1067  **Type**
... ... @@ -1071,72 +1071,81 @@
1071 1071  )))
1072 1072  |(((
1073 1073  (% class="western" %)
1074 -Users
876 +QuestionId
1075 1075  )))|(((
1076 1076  (% class="western" %)
1077 -Users
879 +Int
1078 1078  )))|(((
1079 1079  (% class="western" %)
1080 -Users object with update fields. Return property has csv of questions id requested back in Users object.
882 +Returns ONEcount question id on successful update of the question.
1081 1081  )))
1082 -|(((
884 +
1083 1083  (% class="western" %)
1084 -Return
1085 -)))|(((
886 +
887 +
1086 1086  (% class="western" %)
1087 -String
1088 -)))|(((
889 +Example: Get list of questions from api which has FirstName in text
890 +
891 +{{{curl -X GET -H “Appkey: xxx” https://api.onecount.net/v2/questions/lookup?Text=FirstName}}}
892 +
1089 1089  (% class="western" %)
1090 -CSV of ONEcount QuestionId's requested back in Users object in response
1091 -)))
1092 -|(((
894 +{
895 +
1093 1093  (% class="western" %)
1094 -RequestDate
1095 -)))|(((
897 +"result": {
898 +
1096 1096  (% class="western" %)
1097 -Date
1098 -)))|(((
900 +"success": "1",
901 +
1099 1099  (% class="western" %)
1100 -RequestDate to use for the demo update. If not provided current date will be used.
1101 -)))
903 +"error": {
1102 1102  
1103 -(% class="wrapped" %)
1104 -|(((
1105 1105  (% class="western" %)
1106 -**Response**
1107 -)))|(((
906 +"code": "0",
907 +
1108 1108  (% class="western" %)
1109 -**Type**
1110 -)))|(((
909 +"message": ""
910 +
1111 1111  (% class="western" %)
1112 -**Description**
1113 -)))
1114 -|(((
912 +}
913 +
1115 1115  (% class="western" %)
1116 -Users
1117 -)))|=(((
1118 -(% class="western" align="left" %)
1119 -Users
1120 -)))|(((
915 +},
916 +
1121 1121  (% class="western" %)
1122 -Updated user returned with the demo field requested in return parameter in json format.
1123 -)))
918 +"Questions": [
1124 1124  
1125 1125  (% class="western" %)
1126 -
921 +{
1127 1127  
1128 1128  (% class="western" %)
1129 -
924 +"Id": "6",
1130 1130  
1131 1131  (% class="western" %)
1132 -Create new users. Here in this example the JSON for request is passed in userFile.json file.
927 +"Text": "FirstName",
1133 1133  
1134 -{{{curl -X POST -H “Appkey: xxx” -H "Content-Type: application/json" –data-binary -d '@userFile.json' https://api.onecount.net/v2/users}}}
929 +(% class="western" %)
930 +"Type": "1",
1135 1135  
1136 1136  (% class="western" %)
1137 -**Products**
933 +"Alias": "FName"
1138 1138  
1139 1139  (% class="western" %)
936 +}
937 +
938 +(% class="western" %)
939 +]
940 +
941 +(% class="western" %)
942 +}
943 +
944 +(% class="western" %)
945 +
946 +
947 +(% class="western" %)
948 +**COMPONENT: Products**
949 +
950 +(% class="western" %)
1140 1140  This resource is for manipulating products resource. A product can be created, updated or searched.
1141 1141  
1142 1142  (% class="wrapped" %)
... ... @@ -1391,7 +1391,7 @@
1391 1391  
1392 1392  
1393 1393  (% class="western" %)
1394 -**Terms**
1205 +**COMPONENT: Terms**
1395 1395  
1396 1396  (% class="western" %)
1397 1397  This resource is for manipulating terms resource. A term can be created, updated or searched.
... ... @@ -1622,9 +1622,45 @@
1622 1622  
1623 1623  
1624 1624  (% class="western" %)
1625 -**Resources**
1436 +**COMPONENT: Resources**
1626 1626  
1627 1627  (% class="western" %)
1439 +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.
1440 +
1441 +* (((
1442 +(% class="western" %)
1443 +questions
1444 +)))
1445 +* (((
1446 +(% class="western" %)
1447 +users
1448 +)))
1449 +* (((
1450 +(% class="western" %)
1451 +products
1452 +)))
1453 +* (((
1454 +(% class="western" %)
1455 +terms
1456 +)))
1457 +* (((
1458 +(% class="western" %)
1459 +resources
1460 +)))
1461 +* (((
1462 +(% class="western" %)
1463 +sources
1464 +)))
1465 +* (((
1466 +(% class="western" %)
1467 +transactions
1468 +)))
1469 +
1470 +(% class="western" %)
1471 +**
1472 +**
1473 +
1474 +(% class="western" %)
1628 1628  This resource is for manipulating resources resource. A resource can be created, updated or searched.
1629 1629  
1630 1630  (% class="wrapped" %)
... ... @@ -1682,7 +1682,7 @@
1682 1682  
1683 1683  
1684 1684  (% class="western" %)
1685 -**GET method should be used to lookup products.**
1532 +**GET method should be used to lookup resources.**
1686 1686  
1687 1687  (% class="wrapped" %)
1688 1688  |(((
... ... @@ -1737,7 +1737,7 @@
1737 1737  
1738 1738  
1739 1739  (% class="western" %)
1740 -**POST method should be used to create products.**
1587 +**POST method should be used to create resources.**
1741 1741  
1742 1742  (% class="wrapped" %)
1743 1743  |(((
... ... @@ -1768,6 +1768,9 @@
1768 1768  
1769 1769  (% class="western" %)
1770 1770  {"Name":"Test123","Description":Testss","Type":3,"Value":”/digital/”}
1618 +
1619 +(% class="western" %)
1620 +{"Name":"Test123","Description":Testss","Type":3,"Value":[”/digital/”, "/article/"]}
1771 1771  )))
1772 1772  
1773 1773  (% class="wrapped" %)
... ... @@ -1826,6 +1826,9 @@
1826 1826  
1827 1827  (% class="western" %)
1828 1828  {"Name":"Test123","Description":Testss","Type":3,"Value":”/digital/”}
1679 +
1680 +(% class="western" %)
1681 +{"Name":"Test123","Description":Testss","Type":3,"Value":[”/digital/”, "/article/"]}
1829 1829  )))
1830 1830  
1831 1831  (% class="wrapped" %)
... ... @@ -1852,7 +1852,6 @@
1852 1852  
1853 1853  
1854 1854  
1855 -(% class="western" %)
1856 1856  
1857 1857  
1858 1858  (% class="western" %)
... ... @@ -1859,10 +1859,11 @@
1859 1859  
1860 1860  
1861 1861  (% class="western" %)
1862 -**Sources**
1714 +**COMPONENT: Source Codes
1715 +**
1863 1863  
1864 1864  (% class="western" %)
1865 -This resource is for manipulating sources resource. A source can be created, updated or searched.
1718 +This resource is for manipulating source code for a resource. A source code can be created, updated or searched.
1866 1866  
1867 1867  (% class="wrapped" %)
1868 1868  |(((
... ... @@ -2078,7 +2078,7 @@
2078 2078  
2079 2079  
2080 2080  (% class="western" %)
2081 -**Transactions**
1934 +**COMPONENT: Transactions**
2082 2082  
2083 2083  (% class="western" %)
2084 2084  This resource is for manipulating transactions resource. A transaction can be created or searched.
... ... @@ -2244,8 +2244,11 @@
2244 2244  
2245 2245  
2246 2246  
2100 +
2101 +
2247 2247  (% class="western" %)
2248 -**Stats**
2103 +**COMPONENT: Leads
2104 +**
2249 2249  
2250 2250  (% class="western" %)
2251 2251  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.
... ... @@ -2266,7 +2266,8 @@
2266 2266  
2267 2267  
2268 2268  (% class="western" %)
2269 -**Telemarketing**
2125 +**Telemarketing Leads
2126 +**
2270 2270  
2271 2271  (% class="western" %)
2272 2272  
... ... @@ -2417,8 +2417,16 @@
2417 2417  
2418 2418  
2419 2419  
2277 +
2278 +
2279 +
2280 +
2281 +
2282 +
2283 +
2284 +
2420 2420  (% class="western" %)
2421 -**Reference**
2286 +**API REFERENCE**
2422 2422  
2423 2423  (% class="western" %)
2424 2424  **Type: Questions**
... ... @@ -3097,14 +3097,30 @@
3097 3097  )))|(((
3098 3098  (% class="western" %)
3099 3099  String
2965 +
2966 +(% class="western" %)
2967 +or
2968 +
2969 +(% class="western" %)
2970 +Array
3100 3100  )))|(((
3101 3101  (% class="western" %)
3102 -Value of Resource Type.
2973 +Value of Resource Type:
3103 3103  
3104 3104  (% class="western" %)
3105 -Example : if the Type sent is 3 then Value would be **/digital/**
2976 +When requesting a resource (GET), you should expect a string if there is only one value. If there are multiple values, you should expect an array.
3106 3106  
3107 3107  (% class="western" %)
2979 +For creating/updating a resource (POST/PUT), it is highly recommended to send an array - this will handle single and multiple value requests.
2980 +
2981 +(% class="western" %)
2982 +Example :
2983 +
2984 +(% class="western" %)
2985 +if the Type sent is 3 with one value then Value would be "**/digital/**" or **["/digital"/].** We recommend using the second approach of **["/digital"/].** **
2986 +**if the Type sent is 3 with two values then Value would be ["**/digital/**", "**/articles/**"]
2987 +
2988 +(% class="western" %)
3108 3108  For Function type resource leave it blank.
3109 3109  )))
3110 3110  |(((
Confluence.Code.ConfluencePageClass[0]
id
... ... @@ -1,1 +1,1 @@
1 -3539005
1 +3539018
url
... ... @@ -1,1 +1,1 @@
1 -https://info.onecount.net//wiki/spaces/OD/pages/3539005/OC-API-04032017
1 +https://info.onecount.net//wiki/spaces/OD/pages/3539018/ONEcount API Documentation