Changes for page OLD-ONEcount API Documentation
Last modified by Admin on 2025/06/27 12:14
Summary
-
Page properties (3 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 -O NEcountAPIDocumentation1 +OC-API-04032017 - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki.o mar1 +XWiki.sonish - Content
-
... ... @@ -1,8 +1,56 @@ 1 +(% class="western" align="center" %) 2 + 3 + 4 +(% class="western" align="center" %) 5 + 6 + 7 +(% class="western" align="center" %) 8 + 9 + 10 +(% class="western" align="center" %) 11 + 12 + 13 +(% class="western" align="center" %) 14 + 15 + 16 +(% class="western" align="center" %) 17 + 18 + 19 +(% class="western" align="center" %) 20 +ONEcount REST API Developer's Guide 21 + 22 +(% class="western" align="center" %) 23 +Version 2.1 24 + 25 +(% class="western" align="center" %) 26 + 27 + 28 +(% class="western" align="center" %) 29 + 30 + 31 +(% class="western" align="center" %) 32 + 33 + 34 +(% class="western" align="center" %) 35 + 36 + 37 +(% class="western" align="center" %) 38 + 39 + 40 +(% class="western" align="center" %) 41 + 42 + 43 +(% class="western" align="center" %) 44 + 45 + 46 +(% class="western" align="center" %) 47 + 48 + 1 1 (% class="western" %) 2 2 **Introduction** 3 3 4 4 (% class="western" %) 5 -ONEcount REST API i sdesignedtolowyoutodirectlymanipulate theunderlyingdata within theONEcountpplication. This API can be used to lookup, create and update different ONEcountdata components which are listed below.53 +ONEcount REST API provides different functionality to accomplish many integration related tasks. This API can be used to lookup, create and updated different ONEcount resources which are listed below. 6 6 7 7 (% class="western" %) 8 8 REST takes advantage of the HTTP request methods to layer itself into the existing HTTP architecture. These operations consist of the following: ... ... @@ -10,11 +10,14 @@ 10 10 1. ((( 11 11 (% class="western" %) 12 12 **GET** - Used for lookup of resources 13 -))) 61 + 62 +* ((( 14 14 1. ((( 15 15 (% class="western" %) 16 16 **PUT** - Used to update a resource 17 17 ))) 67 +))) 68 +))) 18 18 1. ((( 19 19 (% class="western" %) 20 20 **POST** - Used to create a new resource ... ... @@ -21,55 +21,178 @@ 21 21 ))) 22 22 23 23 (% class="western" %) 24 - Specifically, theONEcount API providesto thefollowing components:75 +ONEcount API provides following functionalities: 25 25 26 -1. User data 27 -11. List users 28 -11. Lookup users 29 -11. Create users 30 -11. Update users 31 -1. Questions 32 -11. Lookup questions 33 -11. List questions 34 -11. Create questions 35 -1. Product data 36 -11. Lookup products 37 -11. Create products 38 -11. Update products 39 -1. Term Data 40 -11. Lookup terms 41 -11. Create terms 42 -11. Update terms 43 -1. Resource Data 44 -11. Lookup resources 45 -11. Create resources 46 -11. Update resources 47 -1. Transaction data 48 -11. Lookup transactions 49 -11. Create transactions 50 -1. Source Codes 51 -11. Lookup source code 52 -11. Create source codes 53 -11. Update source codes 54 -1. Attach a resource to a product 55 -1. Leads 56 -11. Create a lead 57 -\\\\\\ 77 +1. ((( 78 +(% class="western" %) 79 +**Lookup** 58 58 81 +* 82 + 59 59 (% class="western" %) 60 - **AccessingAPI**84 +User lookup 61 61 86 +* 87 + 62 62 (% class="western" %) 63 - **RESTAPI URL**: [[https:~~/~~/api.onecount.net/v2/>>url:https://api.onecount.net/v2/||shape="rect"]]89 +Transaction lookup 64 64 91 +* 92 + 65 65 (% class="western" %) 66 - **Appkey**:THIS WILL BE PROVIDED TO YOU94 +Question lookup 67 67 96 +* 97 + 68 68 (% class="western" %) 69 -** 70 -** 99 +Source code lookup 71 71 101 +* 102 + 72 72 (% class="western" %) 104 +Product lookup 105 + 106 +* 107 + 108 +(% class="western" %) 109 +Term lookup 110 + 111 +* 112 + 113 +(% class="western" %) 114 +Resource lookup 115 +))) 116 +1. ((( 117 +(% class="western" %) 118 +**Create** 119 + 120 +* 121 + 122 +(% class="western" %) 123 +Add a user/demo 124 + 125 +* 126 + 127 +(% class="western" %) 128 +Add a question 129 + 130 +* 131 + 132 +(% class="western" %) 133 +Add user transaction 134 + 135 +* 136 + 137 +(% class="western" %) 138 +Add source code 139 + 140 +* 141 + 142 +(% class="western" %) 143 +Add Product 144 + 145 +* 146 + 147 +(% class="western" %) 148 +Add Term 149 + 150 +* 151 + 152 +(% class="western" %) 153 +Add Resource 154 + 155 +* 156 + 157 +(% class="western" %) 158 +Stats – Telemarketing 159 +))) 160 +1. ((( 161 +(% class="western" %) 162 +**Update** 163 + 164 +* 165 + 166 +(% class="western" %) 167 +Update a user/demo 168 + 169 +* 170 + 171 +(% class="western" %) 172 +Update a question 173 + 174 +* 175 + 176 +(% class="western" %) 177 +Update source code 178 + 179 +* 180 + 181 +(% class="western" %) 182 +Update product 183 + 184 +* 185 + 186 +(% class="western" %) 187 +Update term 188 + 189 +* 190 + 191 +(% class="western" %) 192 +Update resource 193 +))) 194 +1. ((( 195 +(% class="western" %) 196 +**List** 197 + 198 +* 199 + 200 +(% class="western" %) 201 +ListQuestions 202 + 203 +* 204 + 205 +(% class="western" %) 206 +ListSourceCodes 207 +))) 208 + 209 +(% class="western" %) 210 + 211 + 212 +1. ((( 213 +(% class="western" %) 214 +**Attach** 215 +))) 216 + 217 +* ((( 218 +(% class="western" %) 219 +Attach resource to product 220 +))) 221 + 222 +(% class="western" %) 223 + 224 + 225 +(% class="western" %) 226 + 227 + 228 +(% class="western" %) 229 +**REST API URL**: [[https:~~/~~/api.onecount.net/v2/>>url:https://api.onecount.net/v2/||shape="rect" class="western"]] 230 + 231 +(% class="western" %) 232 +**Appkey**: THIS WILL BE PROVIDED 233 + 234 +(% class="western" %) 235 + 236 + 237 +(% class="western" %) 238 +**Function** 239 + 240 +(% class="western" %) 241 +The ONEcount REST API will be used to create, update & lookup users, transactions and questions e.t.c. in ONEcount hosted install of the client. 242 + 243 +(% class="western" %) 244 +**Accessing API** 245 + 246 +(% class="western" %) 73 73 Your HTTP requests to a REST API resource should contain the following information: 74 74 75 75 * ((( ... ... @@ -90,12 +90,9 @@ 90 90 ))) 91 91 92 92 (% class="western" %) 93 - 267 +**Request** 94 94 95 95 (% class="western" %) 96 -**General API Usage** 97 - 98 -(% class="western" %) 99 99 The request data in POST (for create and update) will consist of request parameters required by each method in JSON format. Value of resource will determine which resource is being requested and the access method will determine whether you are trying to create, update or lookup that resource. 100 100 101 101 (% class="western" %) ... ... @@ -224,100 +224,133 @@ 224 224 225 225 226 226 (% class="western" %) 227 -** 228 -** 398 +**Resources** 229 229 230 -**COMPONENT: Users** 231 - 232 232 (% class="western" %) 233 - Usersmeansthecustomersof your system. Userscan be added, updated andsearchedforusing theusers resourcefromthe api.For lookup, Ifa returnparameter isspecifiedUsers objectwillhavethosefields. If nothingis specifiedby defaultnly UserIdisturned.401 +Resources are the available entities that can be accessed/modified via API. Each resource can be created, updated or requested by using the corresponding http method described above. 234 234 403 +* ((( 235 235 (% class="western" %) 236 -Additionally (Array of) transaction object specifying parts of the transaction to be added to the new user can be specified. UserId, TransactionId and SubscriptionType will be ignored if specified for this case. As this is new user and new transaction is being added. 405 +questions 406 +))) 407 +* ((( 408 +(% class="western" %) 409 +users 410 +))) 411 +* ((( 412 +(% class="western" %) 413 +products 414 +))) 415 +* ((( 416 +(% class="western" %) 417 +terms 418 +))) 419 +* ((( 420 +(% class="western" %) 421 +resources 422 +))) 423 +* ((( 424 +(% class="western" %) 425 +sources 426 +))) 427 +* ((( 428 +(% class="western" %) 429 +transactions 430 +))) 237 237 238 238 (% class="western" %) 239 - In this case the provided demographic information inusersobjectwill be used tocreate anew user in ONEcount and then a response will be generated. Before creating a new user, a check for duplicate will be performed based on Dedupe columns and if found, and error code will be generated.433 +**Questions** 240 240 241 241 (% class="western" %) 242 - If username andpasswordis not one oftheparametersbeingpassed,thenarandomusername andpasswordwillbegeneratedfortheuserwhilecreatinghis useraccount inONEcount.436 +This resource is for manipulating questions resource. Questions in ONEcount means any question that is asked to the subscriber. It could be any questions that appears on customer forms or print forms that gets answered by a subscriber. Questions api call will allow creation, update and search of question in ONEcount. To add a new questions to the system you'll make a POST api call to the questions resource. 243 243 244 244 (% class="western" %) 245 - Returnparameterwillhavecommaseparatedlist of questionIds thatis requestedback fromtheAPI.439 +The data that is sent should be in JSON format and of type questions as described in References section. The type property of questions object is described below. Questions object will only need a choices block if the question is a multiple choice question(type=4 or 5 or 6) 246 246 247 247 (% class="western" %) 248 - Returnisanoptional parameterinrequest. If return isnotrequested then by default, only UserId (which is ONEcount ID) will be returned in the Users object.442 +There can be 6 types of questions: 249 249 250 - 251 - 252 252 (% class="wrapped" %) 253 253 |((( 254 -(% class="western" %) 255 -** Method**446 +(% class="western" align="center" %) 447 +**Type** 256 256 )))|((( 257 257 (% class="western" %) 258 -**Url** 450 +**Description** 451 +))) 452 +|((( 453 +(% class="western" align="center" %) 454 +1 259 259 )))|((( 260 260 (% class="western" %) 261 - **Action**457 +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 - GET460 +(% class="western" align="center" %) 461 +2 266 266 )))|((( 267 267 (% class="western" %) 268 -/users 464 +Textarea type question or long response type question. 465 +))) 466 +|((( 467 +(% class="western" align="center" %) 468 +3 269 269 )))|((( 270 270 (% class="western" %) 271 - Get users datalimiting25.471 +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 |((( 474 +(% class="western" align="center" %) 475 +4 476 +)))|((( 274 274 (% class="western" %) 275 -GET 478 +Select or dropdown type questions. This is a multiple choice, 1 response type question. When creating this type of question the choices block also needs to be part of the questions object that will hold the possible choices of the select question. 479 +))) 480 +|((( 481 +(% class="western" align="center" %) 482 +5 276 276 )))|((( 277 277 (% class="western" %) 278 -/users/1 485 +Radio button type question. This is a multiple choice, 1 response type question. When creating this type of question the choices block also needs to be part of the questions object that will hold the possible choices of the radio question. 486 +))) 487 +|((( 488 +(% class="western" align="center" %) 489 +6 279 279 )))|((( 280 280 (% class="western" %) 281 - Getdataforuserid1.The useridcan be anumericvalueorahash492 +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 ))) 494 + 495 +(% class="wrapped" %) 283 283 |((( 284 284 (% class="western" %) 285 - GET498 +**Method** 286 286 )))|((( 287 287 (% class="western" %) 288 - /users/lookup?1=user1@[[email.com>>url:http://email.com||shape="rect"]]&return=1,2501 +**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. 504 +**Action** 295 295 ))) 296 296 |((( 297 297 (% class="western" %) 298 - POST508 +GET 299 299 )))|((( 300 300 (% class="western" %) 301 -/u sers511 +/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. 514 +List all questions 308 308 ))) 309 309 |((( 310 310 (% class="western" %) 311 - PUT518 +GET 312 312 )))|((( 313 313 (% class="western" %) 314 -/u sers/1521 +/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. 524 +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 -/u sers/1/partners/2531 +/questions/lookup?Text=Email 328 328 )))|((( 329 329 (% class="western" %) 330 - Getserid 1 andpartnerid 2'sONEcount hash.Theuseridcanbe a numeric valueora hash.534 +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 -/u sers/login541 +/questions 338 338 )))|((( 339 339 (% class="western" %) 340 -C heckto seeuserexistwithusername/email and password.544 +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 - 547 +JSON of the Questions type object needs to be sent as post data. Id field should not be sent. 548 +))) 549 +|((( 345 345 (% class="western" %) 346 - Example:347 - 551 +PUT 552 +)))|((( 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 - 554 +/questions 555 +)))|((( 351 351 (% class="western" %) 352 - OR557 +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. 560 +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 shouldbe used to lookup users.**566 +**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. Returnpropertyhascsvof questionsid requestedbackinUsers object.587 +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"]]590 +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) 593 +Text: Word or phrase that should be present in the question text (String) 594 + 595 +(% class="western" %) 596 +Type: Look up the question type. 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 612 +Questions 421 421 )))|((( 422 422 (% class="western" %) 423 -Found users returned with the demo field requested in return parameter in json format. 615 +Questions 616 +)))|((( 617 +(% class="western" %) 618 +Returns found question details. 424 424 ))) 425 425 426 426 427 427 428 428 (% class="western" %) 429 -**POST method should be used to create users.** 624 +**POST method should be used to create questions. The data that is sent should be in JSON format and of type questions as described in references section. Questions object will only need a choices block if the question is a multiple choice question (type=4 or 5 or 6).** 430 430 431 431 (% class="wrapped" %) 432 432 |((( ... ... @@ -441,49 +441,46 @@ 441 441 ))) 442 442 |((( 443 443 (% class="western" %) 444 - Users639 +Questions 445 445 )))|((( 446 446 (% class="western" %) 447 - Users642 +Questions 448 448 )))|((( 449 449 (% class="western" %) 450 - Users object that containsinformationabout userto create.PartnerIdNeeds tocified.645 +This defines the question contents and possible responses. 451 451 ))) 647 + 648 +(% class="wrapped" %) 452 452 |((( 453 453 (% class="western" %) 454 - Transactions651 +**Response** 455 455 )))|((( 456 456 (% class="western" %) 457 -T ransactions654 +**Type** 458 458 )))|((( 459 459 (% class="western" %) 460 - (Array of) transaction objectspecifying parts of the transaction to be added to the new user. UserId and TransactionId, SubscriptionType will be ignored if specified. As this is new user and new transaction is being added.657 +**Description** 461 461 ))) 462 462 |((( 463 463 (% class="western" %) 464 - DedupeColumns661 +QuestionId 465 465 )))|((( 466 466 (% class="western" %) 467 - String664 +Int 468 468 )))|((( 469 469 (% class="western" %) 470 - CSVofquestion id'sthatshouldbeconsideredto findduplicate.667 +Returns ONEcount question id on successful creation of the question. 471 471 ))) 472 -|((( 669 + 670 + 671 + 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 -))) 673 +PUT method should be used to update question. 482 482 483 483 (% class="wrapped" %) 484 484 |((( 485 485 (% class="western" %) 486 -**Re sponse**678 +**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 688 +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. 691 +Questions 692 +)))|((( 693 +(% class="western" %) 694 +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 -**Re quest**700 +**Response** 514 514 )))|((( 515 515 (% class="western" %) 516 516 **Type** ... ... @@ -520,174 +520,168 @@ 520 520 ))) 521 521 |((( 522 522 (% class="western" %) 523 - Users710 +QuestionId 524 524 )))|((( 525 525 (% class="western" %) 526 - Users713 +Int 527 527 )))|((( 528 528 (% class="western" %) 529 - Users object with update fields.Returnproperty has csvofquestionsidrequestedbackin Usersobject.716 +Returns ONEcount question id on successful update of the question. 530 530 ))) 531 - |(((718 + 532 532 (% class="western" %) 533 - Return534 - )))|(((720 + 721 + 535 535 (% class="western" %) 536 -String 537 -)))|((( 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 + 538 538 (% class="western" %) 539 -CSV of ONEcount QuestionId's requested back in Users object in response 540 -))) 541 -|((( 728 +{ 729 + 542 542 (% class="western" %) 543 - RequestDate544 - )))|(((731 +"result": { 732 + 545 545 (% class="western" %) 546 - Date547 - )))|(((734 +"success": "1", 735 + 548 548 (% class="western" %) 549 -RequestDate to use for the demo update. If not provided current date will be used. 550 -))) 737 +"error": { 551 551 552 -(% class="wrapped" %) 553 -|((( 554 554 (% class="western" %) 555 - **Response**556 - )))|(((740 +"code": "0", 741 + 557 557 (% class="western" %) 558 - **Type**559 - )))|(((743 +"message": "" 744 + 560 560 (% class="western" %) 561 -**Description** 562 -))) 563 -|((( 746 +} 747 + 564 564 (% class="western" %) 565 -Users 566 -)))|=((( 567 -(% class="western" align="left" %) 568 -Users 569 -)))|((( 749 +}, 750 + 570 570 (% class="western" %) 571 -Updated user returned with the demo field requested in return parameter in json format. 572 -))) 752 +"Questions": [ 573 573 574 574 (% class="western" %) 575 - 755 +{ 576 576 577 577 (% class="western" %) 578 - 758 +"Id": "6", 579 579 580 580 (% class="western" %) 581 - Createnew users. Here inthis examplethe JSON for request is passed in userFile.json file.761 +"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}}} 763 +(% class="western" %) 764 +"Type": "1", 584 584 585 585 (% class="western" %) 586 -** 587 -** 767 +"Alias": "FName" 588 588 589 589 (% class="western" %) 590 -** 591 -** 770 +} 592 592 593 - 772 +(% class="western" %) 773 +] 594 594 595 595 (% class="western" %) 596 - **COMPONENT: Questions**776 +} 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 780 +**Users** 781 + 601 601 (% class="western" %) 602 - Thisresource isformanipulatingquestions resource.Questionsin ONEcountans anyquestionthat is asked to the subscriber. Itcouldbeany questionsthat appearson customerformsprintformsthat getsanswered by a subscriber.Questionsapicallwillallowcreation,updateandsearch ofquestionin ONEcount.Toadd a newquestionstothesystemyou'llmakePOST api calltothequestions resource.783 +Users means the customers of your system. Users can be added, updated and searched for using the users resource from the api. For lookup, If a return parameter is specified Users object will have those fields. If nothing is specified by default only UserId is returned. 603 603 604 604 (% class="western" %) 605 - Thedatathatissenthouldbe inJSON formatandof typequestionsasdescribedin Referencessection.Thetypepropertyof questionsobjectisdescribedbelow.Questionsobject willonlyneedachoicesblockifthequestionisamultiplechoicequestion(type=4or5or 6)786 +Additionally (Array of) transaction object specifying parts of the transaction to be added to the new user can be specified. UserId, TransactionId and SubscriptionType will be ignored if specified for this case. As this is new user and new transaction is being added. 606 606 607 607 (% class="western" %) 608 - There can be6types ofquestions: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. 609 609 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 + 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 806 +**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 809 +**Url** 628 628 )))|((( 629 629 (% class="western" %) 630 - Textarea type questionor long response type question.812 +**Action** 631 631 ))) 632 632 |((( 633 -(% class="western" align="center"%)634 - 3815 +(% class="western" %) 816 +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 819 +/users 642 642 )))|((( 643 643 (% class="western" %) 644 - Selector dropdown type questions. This is a multiplechoice, 1responsetype question. When creating this type of question the choices block also needs to be partof the questions object thatwill hold the possible choices ofthe select question.822 +Get users data limiting 25. 645 645 ))) 646 646 |((( 647 -(% class="western" align="center"%)648 - 5825 +(% class="western" %) 826 +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 829 +/users/1 656 656 )))|((( 657 657 (% class="western" %) 658 - Checkboxtypequestion. This isamultiple choice,multi responsetype question.Whencreating this type of question thechoicesblockalsoneedstobepartof the questions objectthat will hold thepossiblechoicesof the checkbox question.832 +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**836 +GET 665 665 )))|((( 666 666 (% class="western" %) 667 - **Url**839 +/users/lookup?1=user1@[[email.com>>url:http://email.com||shape="rect"]]&return=1,2 668 668 )))|((( 669 669 (% class="western" %) 670 -**Action** 842 +Lookup for user whose question id (1) is equal to supplied value. The users object returned will have value of questions 1 & 2. Here for example assumed to be firstname and last name. 843 + 844 +(% class="western" %) 845 +Return parameter defines a csv of question id that are requested back in response. 671 671 ))) 672 672 |((( 673 673 (% class="western" %) 674 - GET849 +POST 675 675 )))|((( 676 676 (% class="western" %) 677 -/ questions852 +/users 678 678 )))|((( 679 679 (% class="western" %) 680 -List all questions 855 +Create a new users 856 + 857 +(% class="western" %) 858 +Parameters required to create the user needs to be sent as post data in JSON format. 681 681 ))) 682 682 |((( 683 683 (% class="western" %) 684 - GET862 +PUT 685 685 )))|((( 686 686 (% class="western" %) 687 -/ questions/1865 +/users/1 688 688 )))|((( 689 689 (% class="western" %) 690 -Returns question id 1 868 +Update user id 1. The user id can be a numeric value or a hash 869 + 870 +(% class="western" %) 871 +Parameters required to update the user needs to be sent as post data in JSON format. 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=Email878 +/users/1/partners/2 698 698 )))|((( 699 699 (% class="western" %) 700 - Returns allquestionswith“Email"inquestiontext881 +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 -/ questions888 +/users/login 708 708 )))|((( 709 709 (% class="western" %) 710 -C reateanewquestion891 +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 -|((( 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 + 716 716 (% class="western" %) 717 - PUT718 - )))|(((897 +Example: 898 + 719 719 (% class="western" %) 720 - /questions721 - )))|(((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 + 722 722 (% class="western" %) 723 - Update a question903 +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. 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. 727 727 ))) 728 728 729 729 730 730 731 731 (% class="western" %) 732 -**GET method canbe used to lookupquestions.**921 +**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 thatauser isryingtosearch.942 +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: 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"]] 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. 948 +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 951 + 952 + 953 + 954 + 765 765 (% class="wrapped" %) 766 766 |((( 767 767 (% class="western" %) ... ... @@ -775,19 +775,19 @@ 775 775 ))) 776 776 |((( 777 777 (% class="western" %) 778 -Questions 968 +Users 969 +)))|=((( 970 +(% class="western" align="left" %) 971 +Users 779 779 )))|((( 780 780 (% class="western" %) 781 -Questions 782 -)))|((( 783 -(% class="western" %) 784 -Returns found question details. 974 +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. Thedata that is sent should be in JSON format and of type questions as described in references section.Questions object will only need a choices block if the question is a multiple choice question (type=4 or 5 or 6).**980 +**POST method should be used to create users.** 791 791 792 792 (% class="wrapped" %) 793 793 |((( ... ... @@ -802,46 +802,49 @@ 802 802 ))) 803 803 |((( 804 804 (% class="western" %) 805 - Questions995 +Users 806 806 )))|((( 807 807 (% class="western" %) 808 - Questions998 +Users 809 809 )))|((( 810 810 (% class="western" %) 811 - Thisdefinesthequestioncontentsandpossibleresponses.1001 +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**1005 +Transactions 818 818 )))|((( 819 819 (% class="western" %) 820 - **Type**1008 +Transactions 821 821 )))|((( 822 822 (% class="western" %) 823 - **Description**1011 +(Array of) transaction object specifying parts of the transaction to be added to the new user. UserId and TransactionId, SubscriptionType will be ignored if specified. As this is new user and new transaction is being added. 824 824 ))) 825 825 |((( 826 826 (% class="western" %) 827 - QuestionId1015 +DedupeColumns 828 828 )))|((( 829 829 (% class="western" %) 830 - Int1018 +String 831 831 )))|((( 832 832 (% class="western" %) 833 - ReturnsONEcountquestion idonsuccessful creationofthe question.1021 +CSV of question id's that should be considered to find duplicate. 834 834 ))) 835 - 836 - 837 - 1023 +|((( 838 838 (% class="western" %) 839 -PUT method should be used to update question. 1025 +Return 1026 +)))|((( 1027 +(% class="western" %) 1028 +String 1029 +)))|((( 1030 +(% class="western" %) 1031 +CSV of ONEcount QuestionId's requested back in Users object in response. 1032 +))) 840 840 841 841 (% class="wrapped" %) 842 842 |((( 843 843 (% class="western" %) 844 -**Re quest**1037 +**Response** 845 845 )))|((( 846 846 (% class="western" %) 847 847 **Type** ... ... @@ -851,19 +851,24 @@ 851 851 ))) 852 852 |((( 853 853 (% class="western" %) 854 -Questions 1047 +Users 1048 +)))|=((( 1049 +(% class="western" align="left" %) 1050 +Users 855 855 )))|((( 856 856 (% class="western" %) 857 -Questions 858 -)))|((( 859 -(% class="western" %) 860 -This defines the question contents and responses. 1053 +Created users returned with the demo field requested in return parameter in json format. If return was not specified only UserId will be returned. 861 861 ))) 862 862 1056 + 1057 + 1058 +(% class="western" %) 1059 +**PUT method should be used to update users.** 1060 + 863 863 (% class="wrapped" %) 864 864 |((( 865 865 (% class="western" %) 866 -**Re sponse**1064 +**Request** 867 867 )))|((( 868 868 (% class="western" %) 869 869 **Type** ... ... @@ -873,81 +873,72 @@ 873 873 ))) 874 874 |((( 875 875 (% class="western" %) 876 - QuestionId1074 +Users 877 877 )))|((( 878 878 (% class="western" %) 879 - Int1077 +Users 880 880 )))|((( 881 881 (% class="western" %) 882 -Returns ONEcountquestion idon successful updateofthequestion.1080 +Users object with update fields. Return property has csv of questions id requested back in Users object. 883 883 ))) 884 - 1082 +|((( 885 885 (% class="western" %) 886 - 887 - 1084 +Return 1085 +)))|((( 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 - 1087 +String 1088 +)))|((( 893 893 (% class="western" %) 894 -{ 895 - 1090 +CSV of ONEcount QuestionId's requested back in Users object in response 1091 +))) 1092 +|((( 896 896 (% class="western" %) 897 - "result": {898 - 1094 +RequestDate 1095 +)))|((( 899 899 (% class="western" %) 900 - "success": "1",901 - 1097 +Date 1098 +)))|((( 902 902 (% class="western" %) 903 -"error": { 1100 +RequestDate to use for the demo update. If not provided current date will be used. 1101 +))) 904 904 1103 +(% class="wrapped" %) 1104 +|((( 905 905 (% class="western" %) 906 - "code": "0",907 - 1106 +**Response** 1107 +)))|((( 908 908 (% class="western" %) 909 - "message": ""910 - 1109 +**Type** 1110 +)))|((( 911 911 (% class="western" %) 912 -} 913 - 1112 +**Description** 1113 +))) 1114 +|((( 914 914 (% class="western" %) 915 -}, 916 - 1116 +Users 1117 +)))|=((( 1118 +(% class="western" align="left" %) 1119 +Users 1120 +)))|((( 917 917 (% class="western" %) 918 -"Questions": [ 1122 +Updated user returned with the demo field requested in return parameter in json format. 1123 +))) 919 919 920 920 (% class="western" %) 921 - {1126 + 922 922 923 923 (% class="western" %) 924 - "Id":"6",1129 + 925 925 926 926 (% class="western" %) 927 - "Text":"FirstName",1132 +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", 1134 +{{{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"1137 +**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}1308 +{"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}1366 +{"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**1394 +**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**1625 +**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 r esources.**1685 +**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 r esources.**1740 +**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 1855 +(% 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 -** 1862 +**Sources** 1716 1716 1717 1717 (% class="western" %) 1718 -This resource is for manipulating source code fora resource. A source code can be created, updated or searched.1865 +This resource is for manipulating sources resource. A source can be created, updated or searched. 1719 1719 1720 1720 (% class="wrapped" %) 1721 1721 |((( ... ... @@ -1931,7 +1931,7 @@ 1931 1931 1932 1932 1933 1933 (% class="western" %) 1934 -** COMPONENT: Transactions**2081 +**Transactions** 1935 1935 1936 1936 (% class="western" %) 1937 1937 This resource is for manipulating transactions resource. A transaction can be created or searched. ... ... @@ -2097,11 +2097,8 @@ 2097 2097 2098 2098 2099 2099 2100 - 2101 - 2102 2102 (% class="western" %) 2103 -**COMPONENT: Leads 2104 -** 2248 +**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 -** 2269 +**Telemarketing** 2127 2127 2128 2128 (% class="western" %) 2129 2129 ... ... @@ -2274,16 +2274,8 @@ 2274 2274 2275 2275 2276 2276 2277 - 2278 - 2279 - 2280 - 2281 - 2282 - 2283 - 2284 - 2285 2285 (% class="western" %) 2286 -** APIREFERENCE**2421 +**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 :3102 +Value of Resource Type. 2974 2974 2975 2975 (% class="western" %) 2976 - When requesting a resource (GET), you should expectastring if thereis onlyonevalue.Ifthereare multiple values,youshould expectan array.3105 +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 -35390 191 +3539005 - url
-
... ... @@ -1,1 +1,1 @@ 1 -https://info.onecount.net//wiki/spaces/OD/pages/35390 19/ONEcountAPIDocumentation1 +https://info.onecount.net//wiki/spaces/OD/pages/3539005/OC-API-04032017