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

From version 11.1
edited by omar
on 2017/04/13 11:59
Change comment: There is no comment for this version
To version 5.1
edited by Admin
on 2017/04/05 10:32
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.omar
1 +XWiki.Admin
Content
... ... @@ -2,7 +2,7 @@
2 2  **Introduction**
3 3  
4 4  (% class="western" %)
5 -ONEcount REST API is designed to allow you to directly manipulate the underlying data within the ONEcount application. This API can be used to lookup, create and update different ONEcount data components which are listed below.
5 +ONEcount REST API is designed to allow you to directly manipulate the underlying data within the ONEcount application. his API can be used to lookup, create and updated different ONEcount resources which are listed below.
6 6  
7 7  (% class="western" %)
8 8  REST takes advantage of the HTTP request methods to layer itself into the existing HTTP architecture. These operations consist of the following:
... ... @@ -21,42 +21,151 @@
21 21  )))
22 22  
23 23  (% class="western" %)
24 -Specifically, the ONEcount API provides to the following components:
24 +Specifically, the ONEcount API provides following functionalities:
25 25  
26 -1. User data
27 -11. List users
28 -11. Lookup users
29 -11. Create users
30 -11. Update users
31 -1. Questions
32 -11. Lookup questions
33 -11. List questions
34 -11. Create questions
35 -1. Product data
36 -11. Lookup products
37 -11. Create products
38 -11. Update products
39 -1. Term Data
40 -11. Lookup terms
41 -11. Create terms
42 -11. Update terms
43 -1. Resource Data
44 -11. Lookup resources
45 -11. Create resources
46 -11. Update resources
47 -1. Transaction data
48 -11. Lookup transactions
49 -11. Create transactions
50 -1. Source Codes
51 -11. Lookup source code
52 -11. Create source codes
53 -11. Update source codes
54 -1. Attach a resource to a product
55 -1. Leads
56 -11. Create a lead
57 -\\\\\\
26 +1. (((
27 +(% class="western" %)
28 +**Lookup**
58 58  
30 +*
31 +
59 59  (% class="western" %)
33 +User lookup
34 +
35 +*
36 +
37 +(% class="western" %)
38 +Transaction lookup
39 +
40 +*
41 +
42 +(% class="western" %)
43 +Question lookup
44 +
45 +*
46 +
47 +(% class="western" %)
48 +Source code lookup
49 +
50 +*
51 +
52 +(% class="western" %)
53 +Product lookup
54 +
55 +*
56 +
57 +(% class="western" %)
58 +Term lookup
59 +
60 +*
61 +
62 +(% class="western" %)
63 +Resource lookup
64 +)))
65 +1. (((
66 +(% class="western" %)
67 +**Create**
68 +
69 +*
70 +
71 +(% class="western" %)
72 +Add a user/demo
73 +
74 +*
75 +
76 +(% class="western" %)
77 +Add a question
78 +
79 +*
80 +
81 +(% class="western" %)
82 +Add user transaction
83 +
84 +*
85 +
86 +(% class="western" %)
87 +Add source code
88 +
89 +*
90 +
91 +(% class="western" %)
92 +Add Product
93 +
94 +*
95 +
96 +(% class="western" %)
97 +Add Term
98 +
99 +*
100 +
101 +(% class="western" %)
102 +Add Resource
103 +
104 +*
105 +
106 +(% class="western" %)
107 +Stats – Telemarketing
108 +)))
109 +1. (((
110 +(% class="western" %)
111 +**Update**
112 +
113 +*
114 +
115 +(% class="western" %)
116 +Update a user/demo
117 +
118 +*
119 +
120 +(% class="western" %)
121 +Update a question
122 +
123 +*
124 +
125 +(% class="western" %)
126 +Update source code
127 +
128 +*
129 +
130 +(% class="western" %)
131 +Update product
132 +
133 +*
134 +
135 +(% class="western" %)
136 +Update term
137 +
138 +*
139 +
140 +(% class="western" %)
141 +Update resource
142 +)))
143 +1. (((
144 +(% class="western" %)
145 +**List**
146 +
147 +*
148 +
149 +(% class="western" %)
150 +ListQuestions
151 +
152 +*
153 +
154 +(% class="western" %)
155 +ListSourceCodes
156 +)))
157 +1. **Attach**
158 +
159 +*
160 +** (((
161 +(% class="western" %)
162 +Attach resource to product
163 +)))
164 +
165 +(% class="western" %)
166 +
167 +
168 +(% class="western" %)
60 60  **Accessing API**
61 61  
62 62  (% class="western" %)
... ... @@ -93,7 +93,7 @@
93 93  
94 94  
95 95  (% class="western" %)
96 -**General API Usage**
205 +**API Usage**
97 97  
98 98  (% class="western" %)
99 99  The request data in POST (for create and update) will consist of request parameters required by each method in JSON format. Value of resource will determine which resource is being requested and the access method will determine whether you are trying to create, update or lookup that resource.
... ... @@ -227,97 +227,142 @@
227 227  **
228 228  **
229 229  
230 -**COMPONENT: Users**
339 +(% class="western" %)
340 +**
341 +**
231 231  
232 232  (% class="western" %)
233 -Users means the customers of your system. Users can be added, updated and searched for using the users resource from the api. For lookup, If a return parameter is specified Users object will have those fields. If nothing is specified by default only UserId is returned.
344 +**
345 +**
234 234  
235 235  (% class="western" %)
236 -Additionally (Array of) transaction object specifying parts of the transaction to be added to the new user can be specified. UserId, TransactionId and SubscriptionType will be ignored if specified for this case. As this is new user and new transaction is being added.
348 +**Resources**
237 237  
238 238  (% class="western" %)
239 -In this case the provided demographic information in users object will be used to create a new user in ONEcount and then a response will be generated. Before creating a new user, a check for duplicate will be performed based on Dedupe columns and if found, and error code will be generated.
351 +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.
240 240  
353 +* (((
241 241  (% class="western" %)
242 -If username and password is not one of the parameters being passed, then a random username and password will be generated for the user while creating his user account in ONEcount.
355 +questions
356 +)))
357 +* (((
358 +(% class="western" %)
359 +users
360 +)))
361 +* (((
362 +(% class="western" %)
363 +products
364 +)))
365 +* (((
366 +(% class="western" %)
367 +terms
368 +)))
369 +* (((
370 +(% class="western" %)
371 +resources
372 +)))
373 +* (((
374 +(% class="western" %)
375 +sources
376 +)))
377 +* (((
378 +(% class="western" %)
379 +transactions
380 +)))
243 243  
244 244  (% class="western" %)
245 -Return parameter will have the comma separated list of question Ids that is requested back from the API.
383 +**Questions**
246 246  
247 247  (% class="western" %)
248 -Return is an optional parameter in request. If return is not requested then by default, only UserId (which is ONEcount ID) will be returned in the Users object.
386 +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.
249 249  
250 -
388 +(% class="western" %)
389 +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)
251 251  
391 +(% class="western" %)
392 +There can be 6 types of questions:
393 +
252 252  (% class="wrapped" %)
253 253  |(((
254 -(% class="western" %)
255 -**Method**
396 +(% class="western" align="center" %)
397 +**Type**
256 256  )))|(((
257 257  (% class="western" %)
258 -**Url**
400 +**Description**
401 +)))
402 +|(((
403 +(% class="western" align="center" %)
404 +1
259 259  )))|(((
260 260  (% class="western" %)
261 -**Action**
407 +Textbox type questions or short response type question. The response length needs to be less than 255 characters.
262 262  )))
263 263  |(((
264 -(% class="western" %)
265 -GET
410 +(% class="western" align="center" %)
411 +2
266 266  )))|(((
267 267  (% class="western" %)
268 -/users
414 +Textarea type question or long response type question.
415 +)))
416 +|(((
417 +(% class="western" align="center" %)
418 +3
269 269  )))|(((
270 270  (% class="western" %)
271 -Get users data limiting 25.
421 +Password type question. This is basically same as type 1 but when displayed in ONEcount frontend forms typed characters appears as *.
272 272  )))
273 273  |(((
424 +(% class="western" align="center" %)
425 +4
426 +)))|(((
274 274  (% class="western" %)
275 -GET
428 +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.
429 +)))
430 +|(((
431 +(% class="western" align="center" %)
432 +5
276 276  )))|(((
277 277  (% class="western" %)
278 -/users/1
435 +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.
436 +)))
437 +|(((
438 +(% class="western" align="center" %)
439 +6
279 279  )))|(((
280 280  (% class="western" %)
281 -Get data for user id 1. The user id can be a numeric value or a hash
442 +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.
282 282  )))
444 +
445 +(% class="wrapped" %)
283 283  |(((
284 284  (% class="western" %)
285 -GET
448 +**Method**
286 286  )))|(((
287 287  (% class="western" %)
288 -/users/lookup?1=user1@[[email.com>>url:http://email.com||shape="rect"]]&return=1,2
451 +**Url**
289 289  )))|(((
290 290  (% class="western" %)
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.
454 +**Action**
295 295  )))
296 296  |(((
297 297  (% class="western" %)
298 -POST
458 +GET
299 299  )))|(((
300 300  (% class="western" %)
301 -/users
461 +/questions
302 302  )))|(((
303 303  (% class="western" %)
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.
464 +List all questions
308 308  )))
309 309  |(((
310 310  (% class="western" %)
311 -PUT
468 +GET
312 312  )))|(((
313 313  (% class="western" %)
314 -/users/1
471 +/questions/1
315 315  )))|(((
316 316  (% class="western" %)
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.
474 +Returns question id 1
321 321  )))
322 322  |(((
323 323  (% class="western" %)
... ... @@ -324,10 +324,10 @@
324 324  GET
325 325  )))|(((
326 326  (% class="western" %)
327 -/users/1/partners/2
481 +/questions/lookup?Text=Email
328 328  )))|(((
329 329  (% class="western" %)
330 -Get user id 1 and partner id 2's ONEcount hash. The user id can be a numeric value or a hash.
484 +Returns all questions with “Email" in question text
331 331  )))
332 332  |(((
333 333  (% class="western" %)
... ... @@ -334,40 +334,32 @@
334 334  POST
335 335  )))|(((
336 336  (% class="western" %)
337 -/users/login
491 +/questions
338 338  )))|(((
339 339  (% class="western" %)
340 -Check to see user exist with username/email and password.
494 +Create a new question
341 341  
342 342  (% class="western" %)
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 -
497 +JSON of the Questions type object needs to be sent as post data. Id field should not be sent.
498 +)))
499 +|(((
345 345  (% class="western" %)
346 -Example:
347 -
501 +PUT
502 +)))|(((
348 348  (% class="western" %)
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 -
504 +/questions
505 +)))|(((
351 351  (% class="western" %)
352 -OR
507 +Update a question
353 353  
354 354  (% class="western" %)
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.
510 +JSON of the Questions type object needs to be sent as post data. Id field is mandatory for update.
365 365  )))
366 366  
367 367  
368 368  
369 369  (% class="western" %)
370 -**GET method should be used to lookup users.**
516 +**GET method can be used to lookup questions.**
371 371  
372 372  (% class="wrapped" %)
373 373  |(((
... ... @@ -388,19 +388,18 @@
388 388  String
389 389  )))|(((
390 390  (% class="western" %)
391 -URL encoded key value string parameters for the lookup. Return property has csv of questions id requested back in Users object.
537 +URL encoded key value string parameters for the question that a user is trying to search.
392 392  
393 393  (% class="western" %)
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"]]
540 +Params:
395 395  
396 396  (% class="western" %)
397 -return: csv of question id that is requested back. The Users object returned will only have these properties plus UserId (String)
543 +Text: Word or phrase that should be present in the question text (String)
544 +
545 +(% class="western" %)
546 +Type: Look up the question type.
398 398  )))
399 399  
400 -
401 -
402 -
403 -
404 404  (% class="wrapped" %)
405 405  |(((
406 406  (% class="western" %)
... ... @@ -414,19 +414,19 @@
414 414  )))
415 415  |(((
416 416  (% class="western" %)
417 -Users
418 -)))|=(((
419 -(% class="western" align="left" %)
420 -Users
562 +Questions
421 421  )))|(((
422 422  (% class="western" %)
423 -Found users returned with the demo field requested in return parameter in json format.
565 +Questions
566 +)))|(((
567 +(% class="western" %)
568 +Returns found question details.
424 424  )))
425 425  
426 426  
427 427  
428 428  (% class="western" %)
429 -**POST method should be used to create users.**
574 +**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).**
430 430  
431 431  (% class="wrapped" %)
432 432  |(((
... ... @@ -441,49 +441,46 @@
441 441  )))
442 442  |(((
443 443  (% class="western" %)
444 -Users
589 +Questions
445 445  )))|(((
446 446  (% class="western" %)
447 -Users
592 +Questions
448 448  )))|(((
449 449  (% class="western" %)
450 -Users object that contains information about user to create. PartnerId Needs to be specified.
595 +This defines the question contents and possible responses.
451 451  )))
597 +
598 +(% class="wrapped" %)
452 452  |(((
453 453  (% class="western" %)
454 -Transactions
601 +**Response**
455 455  )))|(((
456 456  (% class="western" %)
457 -Transactions
604 +**Type**
458 458  )))|(((
459 459  (% class="western" %)
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.
607 +**Description**
461 461  )))
462 462  |(((
463 463  (% class="western" %)
464 -DedupeColumns
611 +QuestionId
465 465  )))|(((
466 466  (% class="western" %)
467 -String
614 +Int
468 468  )))|(((
469 469  (% class="western" %)
470 -CSV of question id's that should be considered to find duplicate.
617 +Returns ONEcount question id on successful creation of the question.
471 471  )))
472 -|(((
619 +
620 +
621 +
473 473  (% class="western" %)
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 -)))
623 +PUT method should be used to update question.
482 482  
483 483  (% class="wrapped" %)
484 484  |(((
485 485  (% class="western" %)
486 -**Response**
628 +**Request**
487 487  )))|(((
488 488  (% class="western" %)
489 489  **Type**
... ... @@ -493,24 +493,19 @@
493 493  )))
494 494  |(((
495 495  (% class="western" %)
496 -Users
497 -)))|=(((
498 -(% class="western" align="left" %)
499 -Users
638 +Questions
500 500  )))|(((
501 501  (% class="western" %)
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.
641 +Questions
642 +)))|(((
643 +(% class="western" %)
644 +This defines the question contents and responses.
503 503  )))
504 504  
505 -
506 -
507 -(% class="western" %)
508 -**PUT method should be used to update users.**
509 -
510 510  (% class="wrapped" %)
511 511  |(((
512 512  (% class="western" %)
513 -**Request**
650 +**Response**
514 514  )))|(((
515 515  (% class="western" %)
516 516  **Type**
... ... @@ -520,174 +520,168 @@
520 520  )))
521 521  |(((
522 522  (% class="western" %)
523 -Users
660 +QuestionId
524 524  )))|(((
525 525  (% class="western" %)
526 -Users
663 +Int
527 527  )))|(((
528 528  (% class="western" %)
529 -Users object with update fields. Return property has csv of questions id requested back in Users object.
666 +Returns ONEcount question id on successful update of the question.
530 530  )))
531 -|(((
668 +
532 532  (% class="western" %)
533 -Return
534 -)))|(((
670 +
671 +
535 535  (% class="western" %)
536 -String
537 -)))|(((
673 +Example: Get list of questions from api which has FirstName in text
674 +
675 +{{{curl -X GET -H “Appkey: xxx” https://api.onecount.net/v2/questions/lookup?Text=FirstName}}}
676 +
538 538  (% class="western" %)
539 -CSV of ONEcount QuestionId's requested back in Users object in response
540 -)))
541 -|(((
678 +{
679 +
542 542  (% class="western" %)
543 -RequestDate
544 -)))|(((
681 +"result": {
682 +
545 545  (% class="western" %)
546 -Date
547 -)))|(((
684 +"success": "1",
685 +
548 548  (% class="western" %)
549 -RequestDate to use for the demo update. If not provided current date will be used.
550 -)))
687 +"error": {
551 551  
552 -(% class="wrapped" %)
553 -|(((
554 554  (% class="western" %)
555 -**Response**
556 -)))|(((
690 +"code": "0",
691 +
557 557  (% class="western" %)
558 -**Type**
559 -)))|(((
693 +"message": ""
694 +
560 560  (% class="western" %)
561 -**Description**
562 -)))
563 -|(((
696 +}
697 +
564 564  (% class="western" %)
565 -Users
566 -)))|=(((
567 -(% class="western" align="left" %)
568 -Users
569 -)))|(((
699 +},
700 +
570 570  (% class="western" %)
571 -Updated user returned with the demo field requested in return parameter in json format.
572 -)))
702 +"Questions": [
573 573  
574 574  (% class="western" %)
575 -
705 +{
576 576  
577 577  (% class="western" %)
578 -
708 +"Id": "6",
579 579  
580 580  (% class="western" %)
581 -Create new users. Here in this example the JSON for request is passed in userFile.json file.
711 +"Text": "FirstName",
582 582  
583 -{{{curl -X POST -H “Appkey: xxx” -H "Content-Type: application/json" –data-binary -d '@userFile.json' https://api.onecount.net/v2/users}}}
713 +(% class="western" %)
714 +"Type": "1",
584 584  
585 585  (% class="western" %)
586 -**
587 -**
717 +"Alias": "FName"
588 588  
589 589  (% class="western" %)
590 -**
591 -**
720 +}
592 592  
593 -
722 +(% class="western" %)
723 +]
594 594  
595 595  (% class="western" %)
596 -**COMPONENT: Questions**
726 +}
597 597  
598 598  (% 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).
600 600  
730 +**Users**
731 +
601 601  (% class="western" %)
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.
733 +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.
603 603  
604 604  (% class="western" %)
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)
736 +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.
606 606  
607 607  (% class="western" %)
608 -There can be 6 types of questions:
739 +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.
609 609  
741 +(% class="western" %)
742 +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.
743 +
744 +(% class="western" %)
745 +Return parameter will have the comma separated list of question Ids that is requested back from the API.
746 +
747 +(% class="western" %)
748 +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.
749 +
750 +(% class="western" %)
751 +
752 +
610 610  (% class="wrapped" %)
611 611  |(((
612 -(% class="western" align="center" %)
613 -**Type**
614 -)))|(((
615 615  (% class="western" %)
616 -**Description**
617 -)))
618 -|(((
619 -(% class="western" align="center" %)
620 -1
756 +**Method**
621 621  )))|(((
622 622  (% class="western" %)
623 -Textbox type questions or short response type question. The response length needs to be less than 255 characters.
624 -)))
625 -|(((
626 -(% class="western" align="center" %)
627 -2
759 +**Url**
628 628  )))|(((
629 629  (% class="western" %)
630 -Textarea type question or long response type question.
762 +**Action**
631 631  )))
632 632  |(((
633 -(% class="western" align="center" %)
634 -3
765 +(% class="western" %)
766 +GET
635 635  )))|(((
636 636  (% class="western" %)
637 -Password type question. This is basically same as type 1 but when displayed in ONEcount frontend forms typed characters appears as *.
638 -)))
639 -|(((
640 -(% class="western" align="center" %)
641 -4
769 +/users
642 642  )))|(((
643 643  (% class="western" %)
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.
772 +Get users data limiting 25.
645 645  )))
646 646  |(((
647 -(% class="western" align="center" %)
648 -5
775 +(% class="western" %)
776 +GET
649 649  )))|(((
650 650  (% class="western" %)
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
779 +/users/1
656 656  )))|(((
657 657  (% class="western" %)
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.
782 +Get data for user id 1. The user id can be a numeric value or a hash
659 659  )))
660 -
661 -(% class="wrapped" %)
662 662  |(((
663 663  (% class="western" %)
664 -**Method**
786 +GET
665 665  )))|(((
666 666  (% class="western" %)
667 -**Url**
789 +/users/lookup?1=user1@[[email.com>>url:http://email.com||shape="rect"]]&return=1,2
668 668  )))|(((
669 669  (% class="western" %)
670 -**Action**
792 +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.
793 +
794 +(% class="western" %)
795 +Return parameter defines a csv of question id that are requested back in response.
671 671  )))
672 672  |(((
673 673  (% class="western" %)
674 -GET
799 +POST
675 675  )))|(((
676 676  (% class="western" %)
677 -/questions
802 +/users
678 678  )))|(((
679 679  (% class="western" %)
680 -List all questions
805 +Create a new users
806 +
807 +(% class="western" %)
808 +Parameters required to create the user needs to be sent as post data in JSON format.
681 681  )))
682 682  |(((
683 683  (% class="western" %)
684 -GET
812 +PUT
685 685  )))|(((
686 686  (% class="western" %)
687 -/questions/1
815 +/users/1
688 688  )))|(((
689 689  (% class="western" %)
690 -Returns question id 1
818 +Update user id 1. The user id can be a numeric value or a hash
819 +
820 +(% class="western" %)
821 +Parameters required to update the user needs to be sent as post data in JSON format.
691 691  )))
692 692  |(((
693 693  (% class="western" %)
... ... @@ -694,10 +694,10 @@
694 694  GET
695 695  )))|(((
696 696  (% class="western" %)
697 -/questions/lookup?Text=Email
828 +/users/1/partners/2
698 698  )))|(((
699 699  (% class="western" %)
700 -Returns all questions with “Email" in question text
831 +Get user id 1 and partner id 2's ONEcount hash. The user id can be a numeric value or a hash.
701 701  )))
702 702  |(((
703 703  (% class="western" %)
... ... @@ -704,32 +704,40 @@
704 704  POST
705 705  )))|(((
706 706  (% class="western" %)
707 -/questions
838 +/users/login
708 708  )))|(((
709 709  (% class="western" %)
710 -Create a new question
841 +Check to see user exist with username/email and password.
711 711  
712 712  (% class="western" %)
713 -JSON of the Questions type object needs to be sent as post data. Id field should not be sent.
714 -)))
715 -|(((
844 +Parameters required to create JSON object with **u** as username, **e** as email and **p** as password and sent is as POST param.
845 +
716 716  (% class="western" %)
717 -PUT
718 -)))|(((
847 +Example:
848 +
719 719  (% class="western" %)
720 -/questions
721 -)))|(((
850 +{"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"}
851 +
722 722  (% class="western" %)
723 -Update a question
853 +OR
724 724  
725 725  (% class="western" %)
726 -JSON of the Questions type object needs to be sent as post data. Id field is mandatory for update.
856 +{"u":"[[abc@one-count.com>>mailto:abc@one-count.com||shape="rect" class="western"]]","p":"1234"}
857 +
858 +(% class="western" %)
859 +OR
860 +
861 +(% class="western" %)
862 +{"e":"[[abc@one-count.com>>mailto:abc@one-count.com||shape="rect" class="western"]]","p":"1234"}
863 +
864 +(% class="western" %)
865 +**OUTPUT** : Should get ocid of the user if it finds it otherwise get and error with msg user not found.
727 727  )))
728 728  
729 729  
730 730  
731 731  (% class="western" %)
732 -**GET method can be used to lookup questions.**
871 +**GET method should be used to lookup users.**
733 733  
734 734  (% class="wrapped" %)
735 735  |(((
... ... @@ -750,18 +750,19 @@
750 750  String
751 751  )))|(((
752 752  (% class="western" %)
753 -URL encoded key value string parameters for the question that a user is trying to search.
892 +URL encoded key value string parameters for the lookup. Return property has csv of questions id requested back in Users object.
754 754  
755 755  (% class="western" %)
756 -Params:
895 +Params: Value of question Ids: Key value for Lookup question ids for e.g. 1=user1@[[email.com>>url:http://email.com||shape="rect"]]
757 757  
758 758  (% class="western" %)
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.
898 +return: csv of question id that is requested back. The Users object returned will only have these properties plus UserId (String)
763 763  )))
764 764  
901 +
902 +
903 +
904 +
765 765  (% class="wrapped" %)
766 766  |(((
767 767  (% class="western" %)
... ... @@ -775,19 +775,19 @@
775 775  )))
776 776  |(((
777 777  (% class="western" %)
778 -Questions
918 +Users
919 +)))|=(((
920 +(% class="western" align="left" %)
921 +Users
779 779  )))|(((
780 780  (% class="western" %)
781 -Questions
782 -)))|(((
783 -(% class="western" %)
784 -Returns found question details.
924 +Found users returned with the demo field requested in return parameter in json format.
785 785  )))
786 786  
787 787  
788 788  
789 789  (% class="western" %)
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).**
930 +**POST method should be used to create users.**
791 791  
792 792  (% class="wrapped" %)
793 793  |(((
... ... @@ -802,46 +802,49 @@
802 802  )))
803 803  |(((
804 804  (% class="western" %)
805 -Questions
945 +Users
806 806  )))|(((
807 807  (% class="western" %)
808 -Questions
948 +Users
809 809  )))|(((
810 810  (% class="western" %)
811 -This defines the question contents and possible responses.
951 +Users object that contains information about user to create. PartnerId Needs to be specified.
812 812  )))
813 -
814 -(% class="wrapped" %)
815 815  |(((
816 816  (% class="western" %)
817 -**Response**
955 +Transactions
818 818  )))|(((
819 819  (% class="western" %)
820 -**Type**
958 +Transactions
821 821  )))|(((
822 822  (% class="western" %)
823 -**Description**
961 +(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.
824 824  )))
825 825  |(((
826 826  (% class="western" %)
827 -QuestionId
965 +DedupeColumns
828 828  )))|(((
829 829  (% class="western" %)
830 -Int
968 +String
831 831  )))|(((
832 832  (% class="western" %)
833 -Returns ONEcount question id on successful creation of the question.
971 +CSV of question id's that should be considered to find duplicate.
834 834  )))
835 -
836 -
837 -
973 +|(((
838 838  (% class="western" %)
839 -PUT method should be used to update question.
975 +Return
976 +)))|(((
977 +(% class="western" %)
978 +String
979 +)))|(((
980 +(% class="western" %)
981 +CSV of ONEcount QuestionId's requested back in Users object in response.
982 +)))
840 840  
841 841  (% class="wrapped" %)
842 842  |(((
843 843  (% class="western" %)
844 -**Request**
987 +**Response**
845 845  )))|(((
846 846  (% class="western" %)
847 847  **Type**
... ... @@ -851,19 +851,24 @@
851 851  )))
852 852  |(((
853 853  (% class="western" %)
854 -Questions
997 +Users
998 +)))|=(((
999 +(% class="western" align="left" %)
1000 +Users
855 855  )))|(((
856 856  (% class="western" %)
857 -Questions
858 -)))|(((
859 -(% class="western" %)
860 -This defines the question contents and responses.
1003 +Created users returned with the demo field requested in return parameter in json format. If return was not specified only UserId will be returned.
861 861  )))
862 862  
1006 +
1007 +
1008 +(% class="western" %)
1009 +**PUT method should be used to update users.**
1010 +
863 863  (% class="wrapped" %)
864 864  |(((
865 865  (% class="western" %)
866 -**Response**
1014 +**Request**
867 867  )))|(((
868 868  (% class="western" %)
869 869  **Type**
... ... @@ -873,81 +873,72 @@
873 873  )))
874 874  |(((
875 875  (% class="western" %)
876 -QuestionId
1024 +Users
877 877  )))|(((
878 878  (% class="western" %)
879 -Int
1027 +Users
880 880  )))|(((
881 881  (% class="western" %)
882 -Returns ONEcount question id on successful update of the question.
1030 +Users object with update fields. Return property has csv of questions id requested back in Users object.
883 883  )))
884 -
1032 +|(((
885 885  (% class="western" %)
886 -
887 -
1034 +Return
1035 +)))|(((
888 888  (% class="western" %)
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 -
1037 +String
1038 +)))|(((
893 893  (% class="western" %)
894 -{
895 -
1040 +CSV of ONEcount QuestionId's requested back in Users object in response
1041 +)))
1042 +|(((
896 896  (% class="western" %)
897 -"result": {
898 -
1044 +RequestDate
1045 +)))|(((
899 899  (% class="western" %)
900 -"success": "1",
901 -
1047 +Date
1048 +)))|(((
902 902  (% class="western" %)
903 -"error": {
1050 +RequestDate to use for the demo update. If not provided current date will be used.
1051 +)))
904 904  
1053 +(% class="wrapped" %)
1054 +|(((
905 905  (% class="western" %)
906 -"code": "0",
907 -
1056 +**Response**
1057 +)))|(((
908 908  (% class="western" %)
909 -"message": ""
910 -
1059 +**Type**
1060 +)))|(((
911 911  (% class="western" %)
912 -}
913 -
1062 +**Description**
1063 +)))
1064 +|(((
914 914  (% class="western" %)
915 -},
916 -
1066 +Users
1067 +)))|=(((
1068 +(% class="western" align="left" %)
1069 +Users
1070 +)))|(((
917 917  (% class="western" %)
918 -"Questions": [
1072 +Updated user returned with the demo field requested in return parameter in json format.
1073 +)))
919 919  
920 920  (% class="western" %)
921 -{
1076 +
922 922  
923 923  (% class="western" %)
924 -"Id": "6",
1079 +
925 925  
926 926  (% class="western" %)
927 -"Text": "FirstName",
1082 +Create new users. Here in this example the JSON for request is passed in userFile.json file.
928 928  
929 -(% class="western" %)
930 -"Type": "1",
1084 +{{{curl -X POST -H “Appkey: xxx” -H "Content-Type: application/json" –data-binary -d '@userFile.json' https://api.onecount.net/v2/users}}}
931 931  
932 932  (% class="western" %)
933 -"Alias": "FName"
1087 +**Products**
934 934  
935 935  (% 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" %)
951 951  This resource is for manipulating products resource. A product can be created, updated or searched.
952 952  
953 953  (% class="wrapped" %)
... ... @@ -1116,7 +1116,7 @@
1116 1116  Example:
1117 1117  
1118 1118  (% class="western" %)
1119 -{"Title":"Test123","Description": "Testss","Terms":{"Name":"Product123"},"PrimaryFormId":10,"ResourceID":17}
1258 +{"Title":"Test123","Description":Testss","Terms":{"Name":"Product123"},"PrimaryFormId":10,"ResourceID":17}
1120 1120  )))
1121 1121  
1122 1122  (% class="wrapped" %)
... ... @@ -1174,7 +1174,7 @@
1174 1174  **Example**:
1175 1175  
1176 1176  (% class="western" %)
1177 -{"Title":"Test123","Description": "Testss","Terms":{"Name":"Product123"},"PrimaryFormId":10,"ResourceID":17}
1316 +{"Title":"Test123","Description":Testss","Terms":{"Name":"Product123"},"PrimaryFormId":10,"ResourceID":17}
1178 1178  )))
1179 1179  
1180 1180  (% class="wrapped" %)
... ... @@ -1202,7 +1202,7 @@
1202 1202  
1203 1203  
1204 1204  (% class="western" %)
1205 -**COMPONENT: Terms**
1344 +**Terms**
1206 1206  
1207 1207  (% class="western" %)
1208 1208  This resource is for manipulating terms resource. A term can be created, updated or searched.
... ... @@ -1433,45 +1433,9 @@
1433 1433  
1434 1434  
1435 1435  (% class="western" %)
1436 -**COMPONENT: Resources**
1575 +**Resources**
1437 1437  
1438 1438  (% 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" %)
1475 1475  This resource is for manipulating resources resource. A resource can be created, updated or searched.
1476 1476  
1477 1477  (% class="wrapped" %)
... ... @@ -1529,7 +1529,7 @@
1529 1529  
1530 1530  
1531 1531  (% class="western" %)
1532 -**GET method should be used to lookup resources.**
1635 +**GET method should be used to lookup products.**
1533 1533  
1534 1534  (% class="wrapped" %)
1535 1535  |(((
... ... @@ -1584,7 +1584,7 @@
1584 1584  
1585 1585  
1586 1586  (% class="western" %)
1587 -**POST method should be used to create resources.**
1690 +**POST method should be used to create products.**
1588 1588  
1589 1589  (% class="wrapped" %)
1590 1590  |(((
... ... @@ -1615,9 +1615,6 @@
1615 1615  
1616 1616  (% class="western" %)
1617 1617  {"Name":"Test123","Description":Testss","Type":3,"Value":”/digital/”}
1618 -
1619 -(% class="western" %)
1620 -{"Name":"Test123","Description":Testss","Type":3,"Value":[”/digital/”, "/article/"]}
1621 1621  )))
1622 1622  
1623 1623  (% class="wrapped" %)
... ... @@ -1676,9 +1676,6 @@
1676 1676  
1677 1677  (% class="western" %)
1678 1678  {"Name":"Test123","Description":Testss","Type":3,"Value":”/digital/”}
1679 -
1680 -(% class="western" %)
1681 -{"Name":"Test123","Description":Testss","Type":3,"Value":[”/digital/”, "/article/"]}
1682 1682  )))
1683 1683  
1684 1684  (% class="wrapped" %)
... ... @@ -1705,6 +1705,7 @@
1705 1705  
1706 1706  
1707 1707  
1805 +(% class="western" %)
1708 1708  
1709 1709  
1710 1710  (% class="western" %)
... ... @@ -1711,11 +1711,10 @@
1711 1711  
1712 1712  
1713 1713  (% class="western" %)
1714 -**COMPONENT: Source Codes
1715 -**
1812 +**Sources**
1716 1716  
1717 1717  (% class="western" %)
1718 -This resource is for manipulating source code for a resource. A source code can be created, updated or searched.
1815 +This resource is for manipulating sources resource. A source can be created, updated or searched.
1719 1719  
1720 1720  (% class="wrapped" %)
1721 1721  |(((
... ... @@ -1931,7 +1931,7 @@
1931 1931  
1932 1932  
1933 1933  (% class="western" %)
1934 -**COMPONENT: Transactions**
2031 +**Transactions**
1935 1935  
1936 1936  (% class="western" %)
1937 1937  This resource is for manipulating transactions resource. A transaction can be created or searched.
... ... @@ -2099,9 +2099,14 @@
2099 2099  
2100 2100  
2101 2101  
2199 +
2200 +
2201 +
2202 +
2203 +
2204 +
2102 2102  (% class="western" %)
2103 -**COMPONENT: Leads
2104 -**
2206 +**Stats**
2105 2105  
2106 2106  (% class="western" %)
2107 2107  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.
... ... @@ -2122,8 +2122,7 @@
2122 2122  
2123 2123  
2124 2124  (% class="western" %)
2125 -**Telemarketing Leads
2126 -**
2227 +**Telemarketing**
2127 2127  
2128 2128  (% class="western" %)
2129 2129  
... ... @@ -2283,7 +2283,7 @@
2283 2283  
2284 2284  
2285 2285  (% class="western" %)
2286 -**API REFERENCE**
2387 +**Reference**
2287 2287  
2288 2288  (% class="western" %)
2289 2289  **Type: Questions**
... ... @@ -2962,30 +2962,14 @@
2962 2962  )))|(((
2963 2963  (% class="western" %)
2964 2964  String
2965 -
2966 -(% class="western" %)
2967 -or
2968 -
2969 -(% class="western" %)
2970 -Array
2971 2971  )))|(((
2972 2972  (% class="western" %)
2973 -Value of Resource Type:
3068 +Value of Resource Type.
2974 2974  
2975 2975  (% class="western" %)
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.
3071 +Example : if the Type sent is 3 then Value would be **/digital/**
2977 2977  
2978 2978  (% 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" %)
2989 2989  For Function type resource leave it blank.
2990 2990  )))
2991 2991  |(((
Confluence.Code.ConfluencePageClass[0]
id
... ... @@ -1,1 +1,1 @@
1 -3539019
1 +3539007
url
... ... @@ -1,1 +1,1 @@
1 -https://info.onecount.net//wiki/spaces/OD/pages/3539019/ONEcount API Documentation
1 +https://info.onecount.net//wiki/spaces/OD/pages/3539007/ONEcount API Documentation