{"_id":"569752bd8400d52d00dd56ab","parentDoc":null,"githubsync":"","version":{"_id":"5668fab608f90021008e8832","__v":19,"project":"5668fab608f90021008e882f","createdAt":"2015-12-10T04:08:22.769Z","releaseDate":"2015-12-10T04:08:22.769Z","categories":["5668fab708f90021008e8833","569740f124490c3700170a64","569742b58560a60d00e2c25d","569742bd0b09a41900b2446c","569742cd69393517000c82b3","569742f459a6692d003fad8f","569743020b09a41900b2446d","5697430b69393517000c82b5","56a17776470ae00d00c30642","56a2c48a831e2a0d0069b1ad","56b535757bccae0d00e9a1cd","56e1ff6aa49fdc0e005746b5","57e1c88115bf6522002a5e4e","57fa65275ba65a17008b988f","57fbeea34002550e004c032e","58474584889b6c2d00fb86e9","58475dcc64157f0f002f1907","587e7b5158666c2700965d4e","58a349fc30852819007ba083"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.18.0","version":"1.18"},"editedParams":true,"editedParams2":true,"project":"5668fab608f90021008e882f","__v":5,"category":{"_id":"569742f459a6692d003fad8f","pages":["56974f48d231880d00676e6a","56975101d231880d00676e6c","5697511369393517000c82c8","5697512159a6692d003fada0","569752668560a60d00e2c268","569752898560a60d00e2c26b","569752add231880d00676e70","569752bd8400d52d00dd56ab","569752c769393517000c82cc","56e9cf33fae86b0e00e5394f","56e9cfe2af392b170035f68f"],"project":"5668fab608f90021008e882f","version":"5668fab608f90021008e8832","__v":11,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-01-14T06:40:52.350Z","from_sync":false,"order":1,"slug":"api-integration-rest-api","title":"REST API (For App/Backend)"},"user":"56839cf74aecbd0d00a4659e","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-14T07:48:13.148Z","link_external":false,"link_url":"https://documenter.getpostman.com/view/2166502/liftigniter/7TFGvSV#f1086038-210b-a501-1de9-9d0617f6c055","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"curl","code":"curl -H \"Content-Type: application/json\" -d '{\n  \"apiKey\" : \"YOUR_API_KEY\", // REPLACE WITH YOUR API KEY AND DELETE THIS COMMENT\n  \"users\" : [\n    {\n      \"userId\" : \"alfred01\",\n      \"hometown\" : \"Chicago\",\n      \"company\" : \"Smart Light Solutions Ltd.\",\n      \"interests\" : [\"personalization\", \"video\", \"media\"]\n    },\n    {\n      \"userId\" : \"chana\",\n      \"hometown\" : \"London\",\n      \"company\" : \"Good Behaviour Inc.\",\n      \"interests\" : [\"recommender systems\",\"funnel optimization\"]\n    }\n  ]\n}' https://api.petametrics.com/v1/user | python -mjson.tool","name":"cURL correct request"},{"name":"cURL rejected because invalid API key or disabled organization","language":"curl","code":"curl -H \"Content-Type: application/json\" -d '{\n  \"apiKey\" : \"a6f2ae1c-b2d8-4bce-a8e4-1ss00bb26fa4\",\n  \"users\" : [\n    {\n      \"userId\" : \"alfred01\",\n      \"hometown\" : \"Chicago\",\n      \"company\" : \"Smart Light Solutions Ltd.\",\n      \"interests\" : [\"personalization\", \"video\", \"media\"]\n    }\n  ]\n}' https://api.petametrics.com/v1/user | python -mjson.tool"},{"name":"cURL rejected because of missing organization setting","language":"curl","code":"curl -H \"Content-Type: application/json\" -d '{\n  \"apiKey\" : \"a6f2ae1c-b2d8-4bce-a8e4-15b00bb26fa4\",\n  \"users\" : [\n    {\n      \"userId\" : \"alfred01\",\n      \"hometown\" : \"Chicago\",\n      \"company\" : \"Smart Light Solutions Ltd.\",\n      \"interests\" : [\"personalization\", \"video\", \"media\"]\n    }\n  ]\n}' https://api.petametrics.com/v1/user | python -mjson.tool"},{"code":"curl -H \"Content-Type: application/json\" -d '{\n  \"apiKey\" : \"527ccb8c-0f33-47e5-bff8-d9c2bcaef59e\", // REPLACE WITH YOUR API KEY AND DELETE THIS COMMENT\n  \"users\" : [\n    {\n      \"userId\" : \"alfred01\",\n      \"hometown\" : \"Chicago\",\n      \"company\" : \"Smart Light Solutions Ltd.\",\n      \"interests\" : [\"personalization\", \"video\", \"media\"]\n    },\n    {\n      \"hometown\" : \"London\",\n      \"company\" : \"Good Behaviour Inc.\",\n      \"interests\" : [\"recommender systems\",\"funnel optimization\"]\n    }\n  ]\n}' https://api.petametrics.com/v1/user | python -mjson.tool","language":"curl","name":"Rejected because of missing user id field"}]},"method":"post","results":{"codes":[{"status":200,"language":"json","code":"{\n    \"diagnosticMsg\": \"New/updated users will be queryable in 1 to 5 minutes from now\",\n    \"numUsersMarkedForInsertion\": 2,\n    \"numUsersRequestedForInsertion\": 2,\n    \"organization\": \"liftigniter\",\n    \"status\": \"ok: 2/2 users marked for insertion.\",\n    \"statusCode\": 200,\n    \"userIdField\": \"userId\"\n}","name":"marked for insertion"},{"status":400,"language":"json","code":"{\n    \"status\": \"Bad Request: Invalid API key\",\n    \"statusCode\": 400\n}\n","name":"Rejected because invalid API key or disabled organization"},{"name":"Rejected because of missing organization settings","status":403,"language":"json","code":"{\n    \"diagnosticMsg\": \"No users attempted for insertion, because we did not detect user data settings for keytesting. Please contact support:::at:::liftigniter.com for fixing the user data settings\",\n    \"organization\": \"keytesting\",\n    \"status\": \"Forbidden: 0 users inserted.\",\n    \"statusCode\": 403\n}\n"},{"code":"{\n    \"diagnosticMsg\": \"Some users failed to insert for not having an id. New/updated users will be queryable in 1 minute\",\n    \"numUsersMarkedForInsertion\": 1,\n    \"numUsersRequestedForInsertion\": 2,\n    \"organization\": \"liftigniter\",\n    \"status\": \"Bad Request: 1/2 users marked for insertion.\",\n    \"statusCode\": 400,\n    \"userIdField\": \"userId\"\n}","language":"json","status":400,"name":"Rejected some items because of missing user id field"}]},"settings":"569740d169393517000c82b0","auth":"required","params":[{"_id":"56975af38400d52d00dd56b9","ref":"","in":"body","required":false,"desc":"Your LiftIgniter API key.","default":"","type":"string","name":"apiKey"},{"_id":"56975af38400d52d00dd56b7","ref":"","in":"body","required":false,"desc":"Array of users. Each item in the array has to be a JSON object with your key field (which is \"userId\" by default)","default":"","type":"array_object","name":"users"}],"url":"/user"},"isReference":true,"order":10,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"This endpoint is not generally necessary to use, but may be helpful if you have explicit user data that you think might help inform our recommendations.\\n\\nWe recommend talking with the LiftIgniter team before using this endpoint so that we can better scope your needs and figure out whether user data will help inform our recommendation system.\",\n  \"title\": \"Contact us if you are planning to use this\"\n}\n[/block]\nWe use the userId as the primary key for identifying users. Thus, if you send a new event with the same userId, we simply overwrite the information about that user in the data store.\n\nAs we see, you can use a single event to send information about multiple users.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Consistency Between User Data, Activity, And Model Queries\",\n  \"body\": \"In order for us to relate the user data with the activities and model queries, you need to include the same userId value in the activity and in the model queries. If you do so, we will match the userId against the user data store and personalize our recommendations based on that information.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"The field values are restricted to the following types (the restrictions are the same as for inventory items):<ul>\\n<li>String</li>\\n<li>List of strings</li>\\n<li>Number</li></ul>\\nIn particular, we do not support nested JSON objects.\",\n  \"title\": \"Type support\"\n}\n[/block]","excerpt":"","slug":"user","type":"link","title":"/user - POST"}