{"_id":"577c2bb0b20f211700593619","parentDoc":null,"user":"56caca84245b841300806def","__v":3,"project":"56cacb1bc675f50b00a4b619","version":{"_id":"56cacb1cc675f50b00a4b61c","project":"56cacb1bc675f50b00a4b619","__v":14,"createdAt":"2016-02-22T08:47:24.528Z","releaseDate":"2016-02-22T08:47:24.528Z","categories":["56cacb1dc675f50b00a4b61d","56cc10aaca43550b0028125a","56cc10b7b4cbcf0b004a5df9","56cc1bb2272aa4130002ccd2","56cc5834b4cbcf0b004a5f8b","56cda18bface161300dae13b","56d51f2873dcd20b00fb87bb","56fbe0610023171700b96105","57658310c176520e00ea9076","5772bdd48c48e00e00503638","577c1dfe87acf617003c3fcd","579525172979790e00771a15","582b4661cdfdc125000c8684","586365cedfe6cc3700a7be63"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"category":{"_id":"56cc10b7b4cbcf0b004a5df9","project":"56cacb1bc675f50b00a4b619","__v":5,"pages":["56cd503649abf10b0036a1f0","56cd585aa2a95b0b00c6ec0b","56cd591224f28913009575c4","56cd772dd98d851d00c0c447","56d5267b1c4de4130005d804"],"version":"56cacb1cc675f50b00a4b61c","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-23T07:56:39.448Z","from_sync":false,"order":2,"slug":"sdk","title":"PHP SDK"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-05T21:50:40.921Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"Meta data service provides a fast key-value access to your data. Use this to store settings or as a index for other services\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"( AuthenticationService authenticationService )\",\n      \"language\": \"java\",\n      \"name\": \"Signature\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\n  use CodeMojo\\\\Client\\\\Endpoints;\\n  use CodeMojo\\\\Client\\\\Exceptions\\\\Exceptions;\\n  use CodeMojo\\\\Client\\\\Services\\\\AuthenticationService;\\n\\tuse CodeMojo\\\\Client\\\\Services\\\\MetaService;\\n\\n  const CLIENT_ID     = 'YOUR_CLIENT_ID';\\n  const CLIENT_SECRET = 'YOUR_CLIENT_SECRET';\\n\\n  $authService = new AuthenticationService(CLIENT_ID, CLIENT_SECRET, Endpoints::ENV_SANDBOX, function($type){\\n      // Handle the exceptions appropriately\\n  });\\n\\n$metaService = new MetaService($authService);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Parameters\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"authenticationService\",\n    \"0-1\": \"AuthenticationService\",\n    \"0-2\": \"An instance of authentication service. This also determines which server to connect to\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"fn\",\n  \"title\": \"add / update\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"(String key, Mixed value)\",\n      \"language\": \"java\",\n      \"name\": \"Signature\"\n    }\n  ]\n}\n[/block]\n**Returns** Boolean\n\nAdd or update data\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"key\",\n    \"0-1\": \"String\",\n    \"0-2\": \"Key for the pair\",\n    \"1-0\": \"value\",\n    \"1-1\": \"Mixed\",\n    \"1-2\": \"This could be any primitive type or array object. Basically anything that could be encoded to JSON would fit the bill\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"fn\",\n  \"title\": \"get\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"(String key)\",\n      \"language\": \"java\",\n      \"name\": \"Signature\"\n    }\n  ]\n}\n[/block]\n**Returns** Array\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"key\",\n    \"0-1\": \"String\",\n    \"0-2\": \"Key for the pair\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Array\\n(\\n    [value] => value,\\n    [validity] => int_minutes_remaining\\n)\",\n      \"language\": \"json\",\n      \"name\": \"Sample Output\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"fn\",\n  \"title\": \"delete\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"(String key)\",\n      \"language\": \"java\",\n      \"name\": \"Signature\"\n    }\n  ]\n}\n[/block]\n**Returns** Boolean **Throws** ResourceNotFoundException\n\nDelete the meta data\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"key\",\n    \"0-1\": \"String\",\n    \"0-2\": \"Key for the pair\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]","excerpt":"","slug":"meta-data-service","type":"basic","title":"Meta-data Service"}

Meta-data Service


Meta data service provides a fast key-value access to your data. Use this to store settings or as a index for other services [block:code] { "codes": [ { "code": "( AuthenticationService authenticationService )", "language": "java", "name": "Signature" } ] } [/block] [block:code] { "codes": [ { "code": "<?php\n\n use CodeMojo\\Client\\Endpoints;\n use CodeMojo\\Client\\Exceptions\\Exceptions;\n use CodeMojo\\Client\\Services\\AuthenticationService;\n\tuse CodeMojo\\Client\\Services\\MetaService;\n\n const CLIENT_ID = 'YOUR_CLIENT_ID';\n const CLIENT_SECRET = 'YOUR_CLIENT_SECRET';\n\n $authService = new AuthenticationService(CLIENT_ID, CLIENT_SECRET, Endpoints::ENV_SANDBOX, function($type){\n // Handle the exceptions appropriately\n });\n\n$metaService = new MetaService($authService);", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "Parameters" } [/block] [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Description", "0-0": "authenticationService", "0-1": "AuthenticationService", "0-2": "An instance of authentication service. This also determines which server to connect to" }, "cols": 3, "rows": 1 } [/block] [block:api-header] { "type": "fn", "title": "add / update" } [/block] [block:code] { "codes": [ { "code": "(String key, Mixed value)", "language": "java", "name": "Signature" } ] } [/block] **Returns** Boolean Add or update data [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Description", "0-0": "key", "0-1": "String", "0-2": "Key for the pair", "1-0": "value", "1-1": "Mixed", "1-2": "This could be any primitive type or array object. Basically anything that could be encoded to JSON would fit the bill" }, "cols": 3, "rows": 2 } [/block] [block:api-header] { "type": "fn", "title": "get" } [/block] [block:code] { "codes": [ { "code": "(String key)", "language": "java", "name": "Signature" } ] } [/block] **Returns** Array [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Description", "0-0": "key", "0-1": "String", "0-2": "Key for the pair" }, "cols": 3, "rows": 1 } [/block] [block:code] { "codes": [ { "code": "Array\n(\n [value] => value,\n [validity] => int_minutes_remaining\n)", "language": "json", "name": "Sample Output" } ] } [/block] [block:api-header] { "type": "fn", "title": "delete" } [/block] [block:code] { "codes": [ { "code": "(String key)", "language": "java", "name": "Signature" } ] } [/block] **Returns** Boolean **Throws** ResourceNotFoundException Delete the meta data [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Description", "0-0": "key", "0-1": "String", "0-2": "Key for the pair" }, "cols": 3, "rows": 1 } [/block]