{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Catalog Cleanup API - Get Deleted Items","type":"basic","slug":"update-index-api","excerpt":"","body":"For partners using Gooru Search Index, this API allows for periodic update of the same by identifying content items deleted / dropped from Gooru Search index. Gooru maintains the deleted items index for a period of one year. \n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"1. Authentication\"\n}\n[/block]\nAll Gooru API calls must be authenticated using access tokens. To acquire an access token you need an Client Id and Client Secret key. Contact support:::at:::gooru.org for the necessary detail.\n\n**Authenticating with a Client Id and Client Key\n**\nOnce you have a ClientId and Client Key, making API calls is very easy and simple. Please follow the below steps:\n * Call to obtain access token API with header “Authorization”. \n * Header name “Authorization” and header value “Basic [access_token]” \n * Header value is “Basic base64encode(username:password)” - meaning have to encode(base64) “username:password” string and pass it to header. \n * From the the response, extract the “access_token” field that will be needed for subsequent API \n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -i -H \\\"Content-Type: application/json\\\" -H \\\"Authorization: Basic b2liZ2FuZzlAZ29vcnUub3JnOmRvbjEyMzQ=\\\" -d '{ \\\"client_key\\\": \\\"c2hlZWJhbkBnb29ydWxlYXJuaW5nLm9yZw==\\\", \\\"client_id\\\": \\\"ba956a97-ae15-11e5-a302-f8a963065976\\\", \\\"grant_type\\\": \\\"credential\\\" }' -X POST http://www.gooru.org/api/nucleus-auth/v1/token\",\n \"language\": \"curl\",\n \"name\": \"Sample request\"\n }\n ]\n}\n[/block]\n\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\\"user_id\\\":\\\"e1ed49eb-35a0-489b-8dda-b4f7459a1d1d\\\",\\\"username\\\":\\\"david\\\",\\\"client_id\\\":\\\"ba956a97-ae15-11e5-a302-f8a963065976\\\",\\\"provided_at\\\":1466412833174,\\\"prefs\\\":{\\\"email_id\\\":\\\"[email protected]\\\"},\\\"cdn_urls\\\":{\\\"user_cdn_url\\\":\\\"//usercdn.gooru.org/\\\",\\\"content_cdn_url\\\":\\\"//cdn.gooru.org/\\\"},\\\"access_token\\\":\\\"MTQ2NjQxMjgzMzE3NDplMWVkNDllYi0zNWEwLTQ4OWItOGRkYS1iNGY3NDU5YTFkMWQ6YmE5NTZhOTctYWUxNS0xMWU1LWEzMDItZjhhOTYzMDY1OTc2\\\",\\\"firstname\\\":\\\"David\\\",\\\"lastname\\\":\\\"B\\\",\\\"user_category\\\":\\\"student\\\"}\",\n \"language\": \"json\",\n \"name\": \"Response JSON\"\n }\n ]\n}\n[/block]\n\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"2. Get Deleted Items\"\n}\n[/block]\nGiven a content type and timestamp, get the list of deleted content.\n\n**Method Type**\nGET\n\n**API ** \n{REST_END_POINT}/api/nucleus-index-tracker/v1/items/deleted\n\n**Request Headers** \n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Header\",\n \"h-1\": \"Value\",\n \"h-2\": \"Description\",\n \"0-0\": \"Authorization\",\n \"0-1\": \"Token {TOKEN}\",\n \"0-2\": \"Replace the {TOKEN} with actual value of access token obtained from authentication.\",\n \"1-0\": \"Content-Type\",\n \"1-1\": \"application/json\"\n },\n \"cols\": 3,\n \"rows\": 2\n}\n[/block]\n**Path Variables** \n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Name\",\n \"h-1\": \"Data Type\",\n \"h-2\": \"Mandatory\",\n \"h-3\": \"Accepted Values\",\n \"0-0\": \"type\",\n \"0-1\": \"String\",\n \"0-2\": \"Yes\",\n \"0-3\": \"\\\"resource\\\" / \\\"collection\\\"\"\n },\n \"cols\": 4,\n \"rows\": 1\n}\n[/block]\n**Request Parameters** \n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Name\",\n \"0-0\": \"deletedSince\",\n \"1-0\": \"pageNum\",\n \"2-0\": \"pageSize\",\n \"h-1\": \"Data Type\",\n \"0-1\": \"Long\",\n \"1-1\": \"Integer\",\n \"2-1\": \"Integer\",\n \"h-2\": \"Mandatory\",\n \"0-2\": \"Yes\",\n \"1-2\": \"No\",\n \"2-2\": \"No\",\n \"h-3\": \"Default Value\",\n \"0-3\": \"--\",\n \"1-3\": \"1\",\n \"2-3\": \"30\",\n \"h-4\": \"Comment\",\n \"0-4\": \"This timestamp should be in milliseconds and cannot go back more than a year from current time\",\n \"1-4\": \"Page to fetch\",\n \"2-4\": \"Limit to fetch, only 30 records will be given in single call. Increment pageNum to get next set of results.\"\n },\n \"cols\": 5,\n \"rows\": 3\n}\n[/block]\n**Response Header** \n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Header\",\n \"h-1\": \"Description\",\n \"0-0\": \"Index-Type\",\n \"0-1\": \"Will be index type name of the documents returned. (resource / collection)\",\n \"1-0\": \"Content-Length\",\n \"1-1\": \"Will be included if the API response has a body\",\n \"2-0\": \"Content-Type\",\n \"2-1\": \"Will be included if the API response has a body (JSON)\"\n },\n \"cols\": 2,\n \"rows\": 3\n}\n[/block]\n\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -i -H \\\"Content-Type: application/json\\\" -H \\\"Authorization: Token MTQ2OTAwNzcwNTgyMjphbm9ueW1vdXM6YmE5NTZhOTctYWUxNS0xMWU1LWEzMDItZjhhOTYzMDY1OTc2\\\" -X GET 'http://nucleus-qa.gooru.org/api/nucleus-track-index/v1/deleted-items/resource?pageNum=1&pageSize=3&deletedSince=1469007773000'\",\n \"language\": \"curl\",\n \"name\": \"Sample Request\"\n }\n ]\n}\n[/block]\n\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"meta\\\":{\\n \\\"totalCount\\\":2,\\n \\\"requestedPageSize\\\":50,\\n \\\"returnedPageSize\\\":2,\\n \\\"pageNum\\\":1\\n },\\n \\\"content\\\":[{\\n \\\"id\\\":\\\"23a9a0fc-2d29-11e3-9ab2-12314001917b\\\",\\n \\\"deletedAt\\\":\\\"2014-09-18T02:42:16Z\\\"\\n }, {\\n \\\"id\\\":\\\"e450aa64-2d27-11e3-9ab2-12314001917b\\\",\\n \\\"deletedAt\\\":\\\"2015-02-28T07:02:35Z\\\"\\n }]\\n}\",\n \"language\": \"json\",\n \"name\": \"Sample Response\"\n }\n ]\n}\n[/block]\n**HTTP Response Codes** \n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Status Code\",\n \"h-1\": \"Response Body\",\n \"h-2\": \"Description\",\n \"0-0\": \"200 : Success\",\n \"1-0\": \"400 : Bad Request\",\n \"2-0\": \"401 : Unauthorized\",\n \"3-0\": \"404 : Not Found\",\n \"4-0\": \"500 : Internal Server Error\",\n \"4-2\": \"Ideally, users should not see this. This indicates server unknown errors while processing the request. The message may be technical and may not be suitable for end user consumption.\",\n \"2-2\": \"Action requires authentication or session token may have expired. Note that we don’t return www-authenticate headers as we do not want browser to participate in the auth flow.\",\n \"3-2\": \"Entity not found\",\n \"3-1\": \"No Content\",\n \"2-1\": \"No Content\",\n \"1-2\": \"Malformed, invalid or incorrect request or request parameters noted\",\n \"1-1\": \"Specific error message\",\n \"0-1\": \"Detail for entity requested\",\n \"0-2\": \"Operation successful without error\"\n },\n \"cols\": 3,\n \"rows\": 5\n}\n[/block]","updates":[],"order":4,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"579ecb078cc49e0e00dea8e9","createdAt":"2016-08-01T04:07:35.564Z","githubsync":"","version":{"version":"1","version_clean":"1.0.0","codename":"","is_stable":false,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["56439dff9eebf70d00490d58","56439e17c92c470d002dec71","564ce88e802cd02100444274","564d07ff3657c43500bf1d33","564d0a312da1982d00b19b64","564d2aa92da1982d00b19b8c","564d30a8b88a37210082253e","564d362c2da1982d00b19ba0","569d664371e3650d00acf018","569d7eacec29360d00f667c9","569d8006ec29360d00f667cb","569d855e0306a10d00ce99b9","569d91d571e3650d00acf04c","569d91eeceb7510d00f2a6a3","569e8c262d320817003b806d","569e8f802d320817003b8072","56b038c914dfea0d0007cf05","5717b4f0681bb41900fc575a","5718e0a4cd483219007c2c9a","571924c8e967cb1700d078e9","571e2648edc4a92b00a4cc65","576a677a6f15260e001f899b","576c5eaf5738570e00ff070f","578d127ed9c55c2000d4f213","579f90927ebe9b0e00059c50","582c0af888708a0f00570a69"],"_id":"56439dff9eebf70d00490d57","createdAt":"2015-11-11T19:58:55.144Z","project":"56439dfe9eebf70d00490d54","releaseDate":"2015-11-11T19:58:55.144Z","__v":26},"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Access Catalog","slug":"access-catalog","order":9999,"from_sync":false,"reference":false,"_id":"582c0af888708a0f00570a69","createdAt":"2016-11-16T07:30:00.442Z","__v":0,"project":"56439dfe9eebf70d00490d54","version":"56439dff9eebf70d00490d57"},"__v":1,"parentDoc":null,"project":"56439dfe9eebf70d00490d54","user":"567b9bf2b56bac0d0019d914"}