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 16.1
edited by shravya@one-count_com
on 2020/02/26 12:33
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.shravya@one-count_com
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:
... ... @@ -57,15 +57,12 @@
57 57  
58 58  1. (((
59 59  (% class="western" %)
60 -**GET** - Used for lookup of resources
61 -
62 -* (((
12 +**GET** - Used for lookup of resourcesresources
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" %)
... ... @@ -273,7 +273,7 @@
273 273  For lookup, the parameter list will be part of the request url.
274 274  
275 275  (% class="western" %)
276 -
105 +\\
277 277  
278 278  (% class="western" %)
279 279  **Response**
... ... @@ -336,7 +336,7 @@
336 336  The result of the api request will be determined by the value of the success property of result object. Here the value of success will either be 1 (true) or 0 (false) depending on whether the requested action succeed.
337 337  
338 338  (% class="western" %)
339 -
168 +\\
340 340  
341 341  (% class="western" %)
342 342  If value of success is 0 then an error will be generated inside the result object. Code property will have an error code. message property will have the details about the error. This value might be used to display the error in the client application. The response will always have a result object in it plus the individual response listed for each method.
... ... @@ -392,136 +392,103 @@
392 392   ]}]}}}}
393 393  
394 394  (% class="western" %)
395 -
224 +\\
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 -
367 +\\
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,22 @@
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)
397 +return: csv of question id that is requested back. The Users object returned will only have these properties plus UserId (String)
594 594  
595 595  (% class="western" %)
596 -Type: Look up the question type.
400 +If return is not provided, all the demographics will be returned.
597 597  )))
598 598  
403 +\\
404 +
405 +\\
406 +
599 599  (% class="wrapped" %)
600 600  |(((
601 601  (% class="western" %)
... ... @@ -609,19 +609,42 @@
609 609  )))
610 610  |(((
611 611  (% class="western" %)
612 -Questions
420 +Users
421 +)))|=(((
422 +(% class="western" align="left" %)
423 +Users
613 613  )))|(((
614 614  (% class="western" %)
615 -Questions
616 -)))|(((
617 -(% class="western" %)
618 -Returns found question details.
426 +Found users returned with the demo field requested in return parameter in json format.
619 619  )))
620 620  
621 -
429 +\\
622 622  
431 +**Sample response for /users/(% style="color: rgb(80,80,80);" %)25255449(%%)**
432 +
433 +(% class="relative-table" style="width: 100.0%;" %)
434 +|=(((
435 +(% class="content-wrapper" %)
436 +(((
437 +[[image:attach:Screen Shot 2020-02-26 at 11.15.52 AM.png||width="1407"]]
438 +)))
439 +)))
440 +
441 +\\
442 +
443 +**Sample response for /users/lookup?(% style="color: rgb(80,80,80);" %)11=santosh@[[one-count.com>>url:http://one-count.com||shape="rect"]]&return=2,3(%%)**
444 +
445 +|=(((
446 +(% class="content-wrapper" %)
447 +(((
448 +[[image:attach:Screen Shot 2020-02-26 at 11.22.13 AM.png||height="250"]]
449 +)))
450 +)))
451 +
452 +\\
453 +
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).**
455 +**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
470 +Users
640 640  )))|(((
641 641  (% class="western" %)
642 -Questions
473 +Users
643 643  )))|(((
644 644  (% class="western" %)
645 -This defines the question contents and possible responses.
476 +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**
480 +Transactions
652 652  )))|(((
653 653  (% class="western" %)
654 -**Type**
483 +Transactions
655 655  )))|(((
656 656  (% class="western" %)
657 -**Description**
486 +(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
490 +DedupeColumns
662 662  )))|(((
663 663  (% class="western" %)
664 -Int
493 +String
665 665  )))|(((
666 666  (% class="western" %)
667 -Returns ONEcount question id on successful creation of the question.
496 +CSV of question id's that should be considered to find duplicate.
668 668  )))
669 -
670 -
671 -
498 +|(((
672 672  (% class="western" %)
673 -PUT method should be used to update question.
500 +Return
501 +)))|(((
502 +(% class="western" %)
503 +String
504 +)))|(((
505 +(% class="western" %)
506 +CSV of ONEcount QuestionId's requested back in Users object in response.
507 +)))
674 674  
675 675  (% class="wrapped" %)
676 676  |(((
677 677  (% class="western" %)
678 -**Request**
512 +**Response**
679 679  )))|(((
680 680  (% class="western" %)
681 681  **Type**
... ... @@ -685,19 +685,24 @@
685 685  )))
686 686  |(((
687 687  (% class="western" %)
688 -Questions
522 +Users
523 +)))|=(((
524 +(% class="western" align="left" %)
525 +Users
689 689  )))|(((
690 690  (% class="western" %)
691 -Questions
692 -)))|(((
693 -(% class="western" %)
694 -This defines the question contents and responses.
528 +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  
531 +\\
532 +
533 +(% class="western" %)
534 +**PUT method should be used to update users.**
535 +
697 697  (% class="wrapped" %)
698 698  |(((
699 699  (% class="western" %)
700 -**Response**
539 +**Request**
701 701  )))|(((
702 702  (% class="western" %)
703 703  **Type**
... ... @@ -707,168 +707,174 @@
707 707  )))
708 708  |(((
709 709  (% class="western" %)
710 -QuestionId
549 +Users
711 711  )))|(((
712 712  (% class="western" %)
713 -Int
552 +Users
714 714  )))|(((
715 715  (% class="western" %)
716 -Returns ONEcount question id on successful update of the question.
555 +Users object with update fields. Return property has csv of questions id requested back in Users object.
717 717  )))
718 -
557 +|(((
719 719  (% class="western" %)
720 -
721 -
559 +Return
560 +)))|(((
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 -
562 +String
563 +)))|(((
727 727  (% class="western" %)
728 -{
729 -
565 +CSV of ONEcount QuestionId's requested back in Users object in response
566 +)))
567 +|(((
730 730  (% class="western" %)
731 -"result": {
732 -
569 +RequestDate
570 +)))|(((
733 733  (% class="western" %)
734 -"success": "1",
735 -
572 +Date
573 +)))|(((
736 736  (% class="western" %)
737 -"error": {
575 +RequestDate to use for the demo update. If not provided current date will be used.
576 +)))
738 738  
578 +(% class="wrapped" %)
579 +|(((
739 739  (% class="western" %)
740 -"code": "0",
741 -
581 +**Response**
582 +)))|(((
742 742  (% class="western" %)
743 -"message": ""
744 -
584 +**Type**
585 +)))|(((
745 745  (% class="western" %)
746 -}
747 -
587 +**Description**
588 +)))
589 +|(((
748 748  (% class="western" %)
749 -},
750 -
591 +Users
592 +)))|=(((
593 +(% class="western" align="left" %)
594 +Users
595 +)))|(((
751 751  (% class="western" %)
752 -"Questions": [
597 +Updated user returned with the demo field requested in return parameter in json format.
598 +)))
753 753  
754 754  (% class="western" %)
755 -{
601 +\\
756 756  
757 757  (% class="western" %)
758 -"Id": "6",
604 +\\
759 759  
760 760  (% class="western" %)
761 -"Text": "FirstName",
607 +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",
609 +{{{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"
612 +**
613 +**
768 768  
769 769  (% class="western" %)
770 -}
616 +**
617 +**
771 771  
772 -(% class="western" %)
773 -]
619 +\\
774 774  
775 775  (% class="western" %)
776 -}
622 +**COMPONENT: Questions**
777 777  
778 778  (% class="western" %)
625 +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.
628 +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.
631 +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.
634 +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**
638 +(% class="western" align="center" %)
639 +**Type**
807 807  )))|(((
808 808  (% class="western" %)
809 -**Url**
642 +**Description**
643 +)))
644 +|(((
645 +(% class="western" align="center" %)
646 +1
810 810  )))|(((
811 811  (% class="western" %)
812 -**Action**
649 +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
652 +(% class="western" align="center" %)
653 +2
817 817  )))|(((
818 818  (% class="western" %)
819 -/users
656 +Textarea type question or long response type question.
657 +)))
658 +|(((
659 +(% class="western" align="center" %)
660 +3
820 820  )))|(((
821 821  (% class="western" %)
822 -Get users data limiting 25.
663 +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  |(((
666 +(% class="western" align="center" %)
667 +4
668 +)))|(((
825 825  (% class="western" %)
826 -GET
670 +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.
671 +)))
672 +|(((
673 +(% class="western" align="center" %)
674 +5
827 827  )))|(((
828 828  (% class="western" %)
829 -/users/1
677 +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.
678 +)))
679 +|(((
680 +(% class="western" align="center" %)
681 +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
684 +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  )))
686 +
687 +(% class="wrapped" %)
834 834  |(((
835 835  (% class="western" %)
836 -GET
690 +**Method**
837 837  )))|(((
838 838  (% class="western" %)
839 -/users/lookup?1=user1@[[email.com>>url:http://email.com||shape="rect"]]&return=1,2
693 +**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.
696 +**Action**
846 846  )))
847 847  |(((
848 848  (% class="western" %)
849 -POST
700 +GET
850 850  )))|(((
851 851  (% class="western" %)
852 -/users
703 +/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.
706 +List all questions
859 859  )))
860 860  |(((
861 861  (% class="western" %)
862 -PUT
710 +GET
863 863  )))|(((
864 864  (% class="western" %)
865 -/users/1
713 +/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.
716 +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
723 +/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.
726 +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
733 +/questions
889 889  )))|(((
890 890  (% class="western" %)
891 -Check to see user exist with username/email and password.
736 +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 -
739 +JSON of the Questions type object needs to be sent as post data. Id field should not be sent.
740 +)))
741 +|(((
896 896  (% class="western" %)
897 -Example:
898 -
743 +PUT
744 +)))|(((
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 -
746 +/questions
747 +)))|(((
902 902  (% class="western" %)
903 -OR
749 +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.
752 +JSON of the Questions type object needs to be sent as post data. Id field is mandatory for update.
916 916  )))
917 917  
918 -
755 +\\
919 919  
920 920  (% class="western" %)
921 -**GET method should be used to lookup users.**
758 +**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.
779 +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"]]
782 +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)
785 +Text: Word or phrase that should be present in the question text (String)
786 +
787 +(% class="western" %)
788 +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
804 +Questions
972 972  )))|(((
973 973  (% class="western" %)
974 -Found users returned with the demo field requested in return parameter in json format.
807 +Questions
808 +)))|(((
809 +(% class="western" %)
810 +Returns found question details.
975 975  )))
976 976  
977 -
813 +\\
978 978  
979 979  (% class="western" %)
980 -**POST method should be used to create users.**
816 +**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
831 +Questions
996 996  )))|(((
997 997  (% class="western" %)
998 -Users
834 +Questions
999 999  )))|(((
1000 1000  (% class="western" %)
1001 -Users object that contains information about user to create. PartnerId Needs to be specified.
837 +This defines the question contents and possible responses.
1002 1002  )))
839 +
840 +(% class="wrapped" %)
1003 1003  |(((
1004 1004  (% class="western" %)
1005 -Transactions
843 +**Response**
1006 1006  )))|(((
1007 1007  (% class="western" %)
1008 -Transactions
846 +**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.
849 +**Description**
1012 1012  )))
1013 1013  |(((
1014 1014  (% class="western" %)
1015 -DedupeColumns
853 +QuestionId
1016 1016  )))|(((
1017 1017  (% class="western" %)
1018 -String
856 +Int
1019 1019  )))|(((
1020 1020  (% class="western" %)
1021 -CSV of question id's that should be considered to find duplicate.
859 +Returns ONEcount question id on successful creation of the question.
1022 1022  )))
1023 -|(((
861 +
862 +\\
863 +
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 -)))
865 +PUT method should be used to update question.
1033 1033  
1034 1034  (% class="wrapped" %)
1035 1035  |(((
1036 1036  (% class="western" %)
1037 -**Response**
870 +**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
880 +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.
883 +Questions
884 +)))|(((
885 +(% class="western" %)
886 +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**
892 +**Response**
1065 1065  )))|(((
1066 1066  (% class="western" %)
1067 1067  **Type**
... ... @@ -1071,72 +1071,81 @@
1071 1071  )))
1072 1072  |(((
1073 1073  (% class="western" %)
1074 -Users
902 +QuestionId
1075 1075  )))|(((
1076 1076  (% class="western" %)
1077 -Users
905 +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.
908 +Returns ONEcount question id on successful update of the question.
1081 1081  )))
1082 -|(((
910 +
1083 1083  (% class="western" %)
1084 -Return
1085 -)))|(((
912 +\\
913 +
1086 1086  (% class="western" %)
1087 -String
1088 -)))|(((
915 +Example: Get list of questions from api which has FirstName in text
916 +
917 +{{{curl -X GET -H “Appkey: xxx” https://api.onecount.net/v2/questions/lookup?Text=FirstName}}}
918 +
1089 1089  (% class="western" %)
1090 -CSV of ONEcount QuestionId's requested back in Users object in response
1091 -)))
1092 -|(((
920 +{
921 +
1093 1093  (% class="western" %)
1094 -RequestDate
1095 -)))|(((
923 +"result": {
924 +
1096 1096  (% class="western" %)
1097 -Date
1098 -)))|(((
926 +"success": "1",
927 +
1099 1099  (% class="western" %)
1100 -RequestDate to use for the demo update. If not provided current date will be used.
1101 -)))
929 +"error": {
1102 1102  
1103 -(% class="wrapped" %)
1104 -|(((
1105 1105  (% class="western" %)
1106 -**Response**
1107 -)))|(((
932 +"code": "0",
933 +
1108 1108  (% class="western" %)
1109 -**Type**
1110 -)))|(((
935 +"message": ""
936 +
1111 1111  (% class="western" %)
1112 -**Description**
1113 -)))
1114 -|(((
938 +}
939 +
1115 1115  (% class="western" %)
1116 -Users
1117 -)))|=(((
1118 -(% class="western" align="left" %)
1119 -Users
1120 -)))|(((
941 +},
942 +
1121 1121  (% class="western" %)
1122 -Updated user returned with the demo field requested in return parameter in json format.
1123 -)))
944 +"Questions": [
1124 1124  
1125 1125  (% class="western" %)
1126 -
947 +{
1127 1127  
1128 1128  (% class="western" %)
1129 -
950 +"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.
953 +"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}}}
955 +(% class="western" %)
956 +"Type": "1",
1135 1135  
1136 1136  (% class="western" %)
1137 -**Products**
959 +"Alias": "FName"
1138 1138  
1139 1139  (% class="western" %)
962 +}
963 +
964 +(% class="western" %)
965 +]
966 +
967 +(% class="western" %)
968 +}
969 +
970 +(% class="western" %)
971 +\\
972 +
973 +(% class="western" %)
974 +**COMPONENT: Products**
975 +
976 +(% 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" %)
... ... @@ -1220,7 +1220,7 @@
1220 1220  {"ProductID":"65","ResourceID":”121"}
1221 1221  )))
1222 1222  
1223 -
1060 +\\
1224 1224  
1225 1225  (% class="western" %)
1226 1226  **GET method should be used to lookup products.**
... ... @@ -1275,7 +1275,7 @@
1275 1275  Returns found product details.
1276 1276  )))
1277 1277  
1278 -
1115 +\\
1279 1279  
1280 1280  (% class="western" %)
1281 1281  **POST method should be used to create products.**
... ... @@ -1305,7 +1305,7 @@
1305 1305  Example:
1306 1306  
1307 1307  (% class="western" %)
1308 -{"Title":"Test123","Description":Testss","Terms":{"Name":"Product123"},"PrimaryFormId":10,"ResourceID":17}
1145 +{"Title":"Test123","Description": "Testss","Terms":{"Name":"Product123"},"PrimaryFormId":10,"ResourceID":17}
1309 1309  )))
1310 1310  
1311 1311  (% class="wrapped" %)
... ... @@ -1330,7 +1330,7 @@
1330 1330  Product Id of the newly created product.
1331 1331  )))
1332 1332  
1333 -
1170 +\\
1334 1334  
1335 1335  (% class="western" %)
1336 1336  PUT method should be used to update an individual product given the product info.
... ... @@ -1363,7 +1363,7 @@
1363 1363  **Example**:
1364 1364  
1365 1365  (% class="western" %)
1366 -{"Title":"Test123","Description":Testss","Terms":{"Name":"Product123"},"PrimaryFormId":10,"ResourceID":17}
1203 +{"Title":"Test123","Description": "Testss","PrimaryFormId":10,"ResourceID":17}
1367 1367  )))
1368 1368  
1369 1369  (% class="wrapped" %)
... ... @@ -1388,10 +1388,10 @@
1388 1388  Product id of the updated product.
1389 1389  )))
1390 1390  
1391 -
1228 +\\
1392 1392  
1393 1393  (% class="western" %)
1394 -**Terms**
1231 +**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.
... ... @@ -1448,7 +1448,7 @@
1448 1448  JSON of the terms type object needs to be sent as post data. Id field is mandatory for update.
1449 1449  )))
1450 1450  
1451 -
1288 +\\
1452 1452  
1453 1453  (% class="western" %)
1454 1454  **GET method should be used to lookup products.**
... ... @@ -1503,7 +1503,7 @@
1503 1503  Returns found term details.
1504 1504  )))
1505 1505  
1506 -
1343 +\\
1507 1507  
1508 1508  (% class="western" %)
1509 1509  **POST method should be used to create products.**
... ... @@ -1561,7 +1561,7 @@
1561 1561  Term Id of the newly created term.
1562 1562  )))
1563 1563  
1564 -
1401 +\\
1565 1565  
1566 1566  (% class="western" %)
1567 1567  PUT method should be used to update an individual term given the term info.
... ... @@ -1588,7 +1588,7 @@
1588 1588  Term details to be updated in json format to be sent with request. Id property needs to be set to identify the term to be updated.
1589 1589  
1590 1590  (% class="western" %)
1591 -
1428 +\\
1592 1592  
1593 1593  (% class="western" %)
1594 1594  **Example**:
... ... @@ -1619,12 +1619,48 @@
1619 1619  term id of the updated term.
1620 1620  )))
1621 1621  
1622 -
1459 +\\
1623 1623  
1624 1624  (% class="western" %)
1625 -**Resources**
1462 +**COMPONENT: Resources**
1626 1626  
1627 1627  (% class="western" %)
1465 +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.
1466 +
1467 +* (((
1468 +(% class="western" %)
1469 +questions
1470 +)))
1471 +* (((
1472 +(% class="western" %)
1473 +users
1474 +)))
1475 +* (((
1476 +(% class="western" %)
1477 +products
1478 +)))
1479 +* (((
1480 +(% class="western" %)
1481 +terms
1482 +)))
1483 +* (((
1484 +(% class="western" %)
1485 +resources
1486 +)))
1487 +* (((
1488 +(% class="western" %)
1489 +sources
1490 +)))
1491 +* (((
1492 +(% class="western" %)
1493 +transactions
1494 +)))
1495 +
1496 +(% class="western" %)
1497 +**
1498 +**
1499 +
1500 +(% 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" %)
... ... @@ -1679,10 +1679,10 @@
1679 1679  JSON of the resources type object needs to be sent as post data. Id field is mandatory for update.
1680 1680  )))
1681 1681  
1682 -
1555 +\\
1683 1683  
1684 1684  (% class="western" %)
1685 -**GET method should be used to lookup products.**
1558 +**GET method should be used to lookup resources.**
1686 1686  
1687 1687  (% class="wrapped" %)
1688 1688  |(((
... ... @@ -1734,10 +1734,10 @@
1734 1734  Returns found resource details.
1735 1735  )))
1736 1736  
1737 -
1610 +\\
1738 1738  
1739 1739  (% class="western" %)
1740 -**POST method should be used to create products.**
1613 +**POST method should be used to create resources.**
1741 1741  
1742 1742  (% class="wrapped" %)
1743 1743  |(((
... ... @@ -1761,7 +1761,7 @@
1761 1761  resource details in json to be sent as post data. Id should not be set.
1762 1762  
1763 1763  (% class="western" %)
1764 -**Possible Request Params**: Name, Description, Type, Value
1637 +**Possible Request Params**: Name, Description, Type, Value, FreePass
1765 1765  
1766 1766  (% class="western" %)
1767 1767  **Example**:
... ... @@ -1768,6 +1768,15 @@
1768 1768  
1769 1769  (% class="western" %)
1770 1770  {"Name":"Test123","Description":Testss","Type":3,"Value":”/digital/”}
1644 +
1645 +(% class="western" %)
1646 +{"Name":"Test123","Description":Testss","Type":3,"Value":[”/digital/”, "/article/"]}
1647 +
1648 +(% class="western" %)
1649 +{"Name":"Test123","Description":Testss","Type":3,"Value":”/digital/”, "FreePass":1}
1650 +
1651 +(% class="western" %)
1652 +{"Name":"Test123","Description":Testss","Type":3,"Value":[”/digital/”, "/article/"],"FreePass":1}
1771 1771  )))
1772 1772  
1773 1773  (% class="wrapped" %)
... ... @@ -1792,7 +1792,7 @@
1792 1792  Resource Id of the newly created resource.
1793 1793  )))
1794 1794  
1795 -
1677 +\\
1796 1796  
1797 1797  (% class="western" %)
1798 1798  PUT method should be used to update an individual resource given the resource info.
... ... @@ -1816,16 +1816,25 @@
1816 1816  Resource
1817 1817  )))|(((
1818 1818  (% class="western" %)
1819 -Resource details to be updated in json format to be sent with request. Id property needs to be set to identify the resource to be updated.
1701 +Resource details to be updated injsonformat to be sent withrequest. Id property needs to be set to identify the resource to be updated.
1820 1820  
1821 1821  (% class="western" %)
1822 -
1704 +\\
1823 1823  
1824 1824  (% class="western" %)
1825 -Example:
1707 +Examples:
1826 1826  
1827 1827  (% class="western" %)
1828 1828  {"Name":"Test123","Description":Testss","Type":3,"Value":”/digital/”}
1711 +
1712 +(% class="western" %)
1713 +{"Name":"Test123","Description":Testss","Type":3,"Value":[”/digital/”, "/article/"]}
1714 +
1715 +(% class="western" %)
1716 +{"Name":"Test123","Description":Testss","Type":3,"Value":”/digital/”,"FreePass":1}
1717 +
1718 +(% class="western" %)
1719 +{"Name":"Test123","Description":Testss","Type":3,"Value":[”/digital/”, "/article/"],"FreePass":1}
1829 1829  )))
1830 1830  
1831 1831  (% class="wrapped" %)
... ... @@ -1850,19 +1850,19 @@
1850 1850  resource id of the updated resource.
1851 1851  )))
1852 1852  
1853 -
1744 +\\
1854 1854  
1855 -(% class="western" %)
1856 -
1746 +\\
1857 1857  
1858 1858  (% class="western" %)
1859 -
1749 +\\
1860 1860  
1861 1861  (% class="western" %)
1862 -**Sources**
1752 +**COMPONENT: Source Codes
1753 +**
1863 1863  
1864 1864  (% class="western" %)
1865 -This resource is for manipulating sources resource. A source can be created, updated or searched.
1756 +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  |(((
... ... @@ -1916,7 +1916,7 @@
1916 1916  JSON of the Sources type object needs to be sent as post data. Id field is mandatory for update.
1917 1917  )))
1918 1918  
1919 -
1810 +\\
1920 1920  
1921 1921  (% class="western" %)
1922 1922  **Sources can be looked up given the code or Id. GET method should be used for lookup.**
... ... @@ -1971,10 +1971,10 @@
1971 1971  Returns found source details.
1972 1972  )))
1973 1973  
1974 -
1865 +\\
1975 1975  
1976 1976  (% class="western" %)
1977 -
1868 +\\
1978 1978  
1979 1979  (% class="western" %)
1980 1980  POST method should be used to create an individual source given the source parameters.
... ... @@ -2023,7 +2023,7 @@
2023 2023  Returns created source code id.
2024 2024  )))
2025 2025  
2026 -
1917 +\\
2027 2027  
2028 2028  (% class="western" %)
2029 2029  **PUT method can be used to update an individual source given the id.**
... ... @@ -2072,13 +2072,13 @@
2072 2072  Returns updated source id.
2073 2073  )))
2074 2074  
2075 -
1966 +\\
2076 2076  
2077 2077  (% class="western" %)
2078 -
1969 +\\
2079 2079  
2080 2080  (% class="western" %)
2081 -**Transactions**
1972 +**COMPONENT: Transactions**
2082 2082  
2083 2083  (% class="western" %)
2084 2084  This resource is for manipulating transactions resource. A transaction can be created or searched.
... ... @@ -2125,10 +2125,10 @@
2125 2125  JSON of the Transactions type object needs to be sent as post data. Id field should not be sent.
2126 2126  )))
2127 2127  
2128 -
2019 +\\
2129 2129  
2130 2130  (% class="western" %)
2131 -
2022 +\\
2132 2132  
2133 2133  (% class="western" %)
2134 2134  Transactions can be looked up using transactionId, date range, userid. Use GET method to do lookup.
... ... @@ -2167,11 +2167,7 @@
2167 2167  EndDate: When the search should end. Only valid when UserId is set. (Date)
2168 2168  )))
2169 2169  
2170 -
2171 -
2172 -
2173 -
2174 -(% class="wrapped" %)
2061 +(% class="wrapped" style="letter-spacing: 0.0px;" %)
2175 2175  |(((
2176 2176  (% class="western" %)
2177 2177  **Response**
... ... @@ -2190,11 +2190,22 @@
2190 2190  Transactions
2191 2191  )))|(((
2192 2192  (% class="western" %)
2193 -Returns all transaction that satisfies the search criteria.
2080 +Returns all transaction that satisfies the search criteria. Returns all the package and product transactions of the user. Package Transactions are the one with TermId and ProductId. Product Transactions are the one with ResourceId.
2194 2194  )))
2195 2195  
2196 -
2083 +\\
2197 2197  
2085 +**Sample response for /(% style="color: rgb(80,80,80);" %)transactions/lookup?UserId=25255105:(%%)**
2086 +
2087 +|=(((
2088 +(% class="content-wrapper" %)
2089 +(((
2090 +[[image:attach:Screen Shot 2020-02-26 at 11.14.29 AM.png||width="1407"]]
2091 +)))
2092 +)))
2093 +
2094 +\\
2095 +
2198 2198  (% class="western" %)
2199 2199  POST method can be used to create user transaction. Transaction info needs to be sent as request and a TransactionId will be returned when the transaction is created.
2200 2200  
... ... @@ -2242,31 +2242,35 @@
2242 2242  Returns transactionId of the newly created transaction.
2243 2243  )))
2244 2244  
2245 -
2143 +\\
2246 2246  
2145 +\\
2146 +
2247 2247  (% class="western" %)
2248 -**Stats**
2148 +**COMPONENT: Leads
2149 +**
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.
2252 2252  
2253 2253  (% class="western" %)
2254 -
2155 +\\
2255 2255  
2256 2256  (% class="western" %)
2257 -
2158 +\\
2258 2258  
2259 2259  (% class="western" %)
2260 -
2161 +\\
2261 2261  
2262 2262  (% class="western" %)
2263 -
2164 +\\
2264 2264  
2265 2265  (% class="western" %)
2266 -
2167 +\\
2267 2267  
2268 2268  (% class="western" %)
2269 -**Telemarketing**
2170 +**Telemarketing Leads
2171 +**
2270 2270  
2271 2271  (% class="western" %)
2272 2272  
... ... @@ -2314,7 +2314,7 @@
2314 2314  JSON of the Telemarketing type object needs to be sent as post data. Id field should not be sent.
2315 2315  )))
2316 2316  
2317 -
2219 +\\
2318 2318  
2319 2319  (% class="western" %)
2320 2320  POST method can be used to create telemarketing stat. Telemarketing info needs to be sent as request and an Id will be returned when the transaction is created.
... ... @@ -2384,13 +2384,13 @@
2384 2384  )))
2385 2385  |(((
2386 2386  (% class="western" %)
2387 -
2289 +\\
2388 2388  )))|(((
2389 2389  (% class="western" %)
2390 -
2292 +\\
2391 2391  )))|(((
2392 2392  (% class="western" %)
2393 -
2295 +\\
2394 2394  )))
2395 2395  
2396 2396  (% class="wrapped" %)
... ... @@ -2415,10 +2415,18 @@
2415 2415  Returns telemarketing ids of the newly created transaction. If multiple stats are sent, multiple ids are returned in cvs format.
2416 2416  )))
2417 2417  
2418 -
2320 +\\
2419 2419  
2322 +\\
2323 +
2324 +\\
2325 +
2326 +\\
2327 +
2328 +\\
2329 +
2420 2420  (% class="western" %)
2421 -**Reference**
2331 +**API REFERENCE**
2422 2422  
2423 2423  (% class="western" %)
2424 2424  **Type: Questions**
... ... @@ -2464,12 +2464,12 @@
2464 2464  (% class="western" %)
2465 2465  Determines which type of question it is. Textbox, checkbox, select, radio.
2466 2466  There can be 6 types of questions.
2467 - type=1 means textbox type questions or short response type question. The response length needs to be less than 255 characters.
2468 - type=2 means textarea type question or long response type question.
2469 - type=3 means password type question. This is basically same as type 1 but when displayed in ONEcount frontend forms typed characters appears as *
2470 - type = 4 means 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.
2471 - type=5 means 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.
2472 - type=6 means 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.
2377 +type=1 means textbox type questions or short response type question. The response length needs to be less than 255 characters.
2378 +type=2 means textarea type question or long response type question.
2379 +type=3 means password type question. This is basically same as type 1 but when displayed in ONEcount frontend forms typed characters appears as *
2380 +type = 4 means 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.
2381 +type=5 means 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.
2382 +type=6 means 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.
2473 2473  )))
2474 2474  |(((
2475 2475  (% class="western" %)
... ... @@ -2492,13 +2492,13 @@
2492 2492  Alias for admin purpose.
2493 2493  )))
2494 2494  
2495 -
2405 +\\
2496 2496  
2497 2497  (% class="western" %)
2498 -
2408 +\\
2499 2499  
2500 2500  (% class="western" %)
2501 -
2411 +\\
2502 2502  
2503 2503  (% class="western" %)
2504 2504  **Type: Choices**
... ... @@ -2565,7 +2565,7 @@
2565 2565  Tied to which question id.
2566 2566  )))
2567 2567  
2568 -
2478 +\\
2569 2569  
2570 2570  (% class="western" %)
2571 2571  **Type: Users**
... ... @@ -2622,7 +2622,7 @@
2622 2622  Request date.
2623 2623  )))
2624 2624  
2625 -
2535 +\\
2626 2626  
2627 2627  (% class="western" %)
2628 2628  **Type: Demo**
... ... @@ -2669,7 +2669,7 @@
2669 2669  ...
2670 2670  )))
2671 2671  
2672 -
2582 +\\
2673 2673  
2674 2674  (% class="western" %)
2675 2675  **Type: Transactions**
... ... @@ -2816,7 +2816,7 @@
2816 2816  If there is amount (USD) included in transaction.
2817 2817  )))
2818 2818  
2819 -
2729 +\\
2820 2820  
2821 2821  (% class="western" %)
2822 2822  **Type: Sources**
... ... @@ -2873,10 +2873,10 @@
2873 2873  If this is a child source then list the parent source id.
2874 2874  )))
2875 2875  
2876 -
2786 +\\
2877 2877  
2878 2878  (% class="western" %)
2879 -
2789 +\\
2880 2880  
2881 2881  (% class="western" %)
2882 2882  **Type: Products**
... ... @@ -2933,7 +2933,7 @@
2933 2933  (Array of) Terms associated with the product.
2934 2934  )))
2935 2935  
2936 -
2846 +\\
2937 2937  
2938 2938  (% class="western" %)
2939 2939  **Type: Terms**
... ... @@ -3020,7 +3020,7 @@
3020 3020  If there is price (USD) for the term.
3021 3021  )))
3022 3022  
3023 -
2933 +\\
3024 3024  
3025 3025  (% class="western" %)
3026 3026  **Type: Resources**
... ... @@ -3097,14 +3097,30 @@
3097 3097  )))|(((
3098 3098  (% class="western" %)
3099 3099  String
3010 +
3011 +(% class="western" %)
3012 +or
3013 +
3014 +(% class="western" %)
3015 +Array
3100 3100  )))|(((
3101 3101  (% class="western" %)
3102 -Value of Resource Type.
3018 +Value of Resource Type:
3103 3103  
3104 3104  (% class="western" %)
3105 -Example : if the Type sent is 3 then Value would be **/digital/**
3021 +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" %)
3024 +For creating/updating a resource (POST/PUT), it is highly recommended to send an array - this will handle single and multiple value requests.
3025 +
3026 +(% class="western" %)
3027 +Example :
3028 +
3029 +(% class="western" %)
3030 +if the Type sent is 3 with one value then Value would be "**/digital/**" or **["/digital"/].** We recommend using the second approach of **["/digital"/].** **
3031 +**if the Type sent is 3 with two values then Value would be ["**/digital/**", "**/articles/**"]
3032 +
3033 +(% class="western" %)
3108 3108  For Function type resource leave it blank.
3109 3109  )))
3110 3110  |(((
... ... @@ -3115,10 +3115,20 @@
3115 3115  Int
3116 3116  )))|(((
3117 3117  (% class="western" %)
3118 -Default limit is 25 but all the data needs to be pulled then pass limit=0.
3044 +Default limit is 25 but if all the data needs to be pulled then pass limit=0.
3119 3119  )))
3046 +|(% colspan="1" %)(% colspan="1" %)
3047 +(((
3048 +FreePass
3049 +)))|(% colspan="1" %)(% colspan="1" %)
3050 +(((
3051 +Int
3052 +)))|(% colspan="1" %)(% colspan="1" %)
3053 +(((
3054 +Default value is 0. This parameter is used to provide access to protected content.
3055 +)))
3120 3120  
3121 -
3057 +\\
3122 3122  
3123 3123  (% class="western" %)
3124 3124  **Type: Telemarketing**
... ... @@ -3208,8 +3208,12 @@
3208 3208  Page title that belongs to the page url that is being sent. If not provided it try to pull the title from the page but if unsuccessful then it will set it as blank.
3209 3209  
3210 3210  (% class="western" %)
3211 -
3147 +\\
3212 3212  
3213 3213  (% class="western" %)
3214 3214  If the page url already exists and it doesn't match with the one that is being sent then it will throw conflict error with the title in our system.
3215 3215  )))
3152 +
3153 +\\
3154 +
3155 +\\
Confluence.Code.ConfluencePageClass[0]
id
... ... @@ -1,1 +1,1 @@
1 -3539005
1 +23331813
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/23331813/ONEcount API Documentation