{"__v":1,"_id":"5770617ad7c6cd1900a57e7a","category":{"version":"57706179d7c6cd1900a57e6e","project":"56830b883b87430d00483b3d","_id":"57706179d7c6cd1900a57e70","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-29T22:39:05.596Z","from_sync":false,"order":1,"slug":"documentation","title":"Documentation"},"project":"56830b883b87430d00483b3d","user":"56830b4870331a0d00484a77","version":{"__v":1,"_id":"57706179d7c6cd1900a57e6e","project":"56830b883b87430d00483b3d","createdAt":"2016-06-26T23:12:57.873Z","releaseDate":"2016-06-26T23:12:57.873Z","categories":["57706179d7c6cd1900a57e6f","57706179d7c6cd1900a57e70","57706179d7c6cd1900a57e71","57706179d7c6cd1900a57e72","57706179d7c6cd1900a57e73","57706179d7c6cd1900a57e74"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-12T15:30:55.550Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"**By combining the basic and advanced features, apiNG turns into a rocket.** It's nothing less than an extendable platform, where users can collaborate to create new plugins and designs.\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"Social Wall: http://plnkr.co/edit/dz3Dru?p=preview\",\n  \"title\": \"Plnklr demo (view & edit)\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Table of Content\"\n}\n[/block]\n* **[Components](#components)**\n* **[Credential Manager](#credential-manager)**\n* **[Parameters](#parameters)** \n<br>\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Components\"\n}\n[/block]\nBy using this **components**, you are able to use and create re-usable modules for your work with AngularJS.\n \n## Plugins\n**[apiNG Plugins](plugins) work as data sources for specific platforms or protocols** (e.g. Facebook, Youtube, RSS, GitHub, ...)\n* Plugins are easy to configure\n* Plugins could return data in two ways:\n   1. as **native** data\n   2. as **converted** data, transformed into several universal data _models_ (e.g. for images, videos, events, ...)\n* Use **[existing plugins](all-plugins)** \n* [Create your own plugin](plugins#create-new-aping-plugins)\n\n## Models\n**[apiNG Models](models) are universal data models** (e.g. for images, videos, events, social media, ...)\n* Models could be created or changed, just by doing it.\n\n## Designs\n**[apiNG Designs](designs) are templates to display specific _models_**\n* Use [existing designs](all-designs) \n* [Create your own design](designs)\n\n<br>\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Credential Manager\"\n}\n[/block]\nThe **credential manager** is a functionality of apiNG, written to relieve working with plugins, if they have to deal with api keys, access tokens, and other credentials.\n\n:fa-key:  **Copy & paste your credentials for your requests into the [config file](configuration)**. You can store this config file on your webspace and re-use this credentials for some projects.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apingApiKeys: {\\n    youtube : [{'apiKey': '<YOUR_YOUTUBE_API_KEY>'}],\\n    facebook: [{'access_token': '<YOUR_FACEBOOK_TOKEN>'}],\\n    twitter: [{'bearer_token': '<YOUR_TWITTER_BEARER_TOKEN>'}],\\n    vimeo: [{'access_token': '<YOUR_VIMEO_TOKEN>'}],\\n    tumblr: [{'api_key': '<YOUR_TUMBLR_API_KEY>'}],\\n    // ...\\n}\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n<hr>:fa-key:  **Every plugin could be authorized with a credential object:**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apingApiKeys: {\\n    instagram : [{\\n        'api_key': '<YOUR_API_KEY>',\\n        'client_id': '<YOUR_CLIENT_ID>'\\n    }],\\n    // ...\\n}\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n<hr>:fa-key:  **You can store multiple credentials objects _per plugin_ to bypass rate limitations.** The used credential object will get chosen randomly.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apingApiKeys: {\\n    facebook : [\\n        { 'access_token': '<YOUR_ACCESS_TOKEN_1>'},\\n        { 'access_token': '<YOUR_ACCESS_TOKEN_2>'},\\n        { 'access_token': '<YOUR_ACCESS_TOKEN_3>'},\\n        { 'access_token': '<YOUR_ACCESS_TOKEN_4>'}\\n    ],\\n    // ...\\n}\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n<br>\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Parameters\"\n}\n[/block]\nFor advanced usage, there are two additional parameters for apiNG (bold):\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`template-url`\",\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Sample\",\n    \"h-3\": \"Description\",\n    \"h-4\": \"Opt.\",\n    \"0-1\": \"`string`\",\n    \"0-2\": \"`template.html`\",\n    \"0-3\": \"Path to template file.\\nUse result data in template with `{{results}}`\",\n    \"0-4\": \"**no**\",\n    \"1-0\": \"**`model`**\",\n    \"1-1\": \"**`string`**\",\n    \"1-2\": \"**`social`**\",\n    \"1-3\": \"**Chosen data model for this _apiNG instance_**\",\n    \"1-4\": \"yes\",\n    \"2-0\": \"**`get-native-data`**\",\n    \"2-1\": \"**`boolean`**\",\n    \"2-2\": \"**`false`**\",\n    \"2-3\": \"**Use `true` for getting native data from plugins.\\nDefault value:`false`**\",\n    \"2-4\": \"yes\",\n    \"3-0\": \"`items`\",\n    \"3-1\": \"`int`\",\n    \"3-2\": \"`20`\",\n    \"3-3\": \"Number of displayed items per request\",\n    \"3-4\": \"yes\",\n    \"4-0\": \"`max-items`\",\n    \"4-1\": \"`int`\",\n    \"4-2\": \"`100`\",\n    \"4-3\": \"Number of items of this apiNG instance.\\nUse `-1` for no limitation\",\n    \"4-4\": \"yes\",\n    \"5-0\": \"`order-by`\",\n    \"5-1\": \"`string`\",\n    \"5-2\": \"`timestamp`\",\n    \"5-3\": \"Order result by this attribute.\\nUse `$NONE` for no order.\\nUse `$RANDOM` for random order\",\n    \"5-4\": \"yes\",\n    \"6-0\": \"`order-reverse`\",\n    \"6-1\": \"`boolean`\",\n    \"6-2\": \"`false`\",\n    \"6-3\": \"Use `true` for reverse order.\\nDefault value: `false`\",\n    \"6-4\": \"yes\",\n    \"9-0\": \"`remove-doubles`\",\n    \"9-1\": \"`boolean`\",\n    \"9-2\": \"`false`\",\n    \"9-3\": \"Use `true` to remove identical objects\\nor with the same ID (`id-by`).\\nGets ignored if `merge-doubles` is set.\\nDefault value: `false`\",\n    \"9-4\": \"yes\",\n    \"10-0\": \"`payload-json`\",\n    \"10-1\": \"`json object`\",\n    \"10-2\": \"`{'key1':'value1'}`\",\n    \"10-3\": \"Inject additional payload data into your template.\\nUse payload data in template with `{{payload}}`\",\n    \"10-4\": \"yes\",\n    \"11-0\": \"`value-name`\",\n    \"11-1\": \"`string`\",\n    \"11-2\": \"`videos`\",\n    \"11-3\": \"Inject `apingResults` into your app. [(Plnkr)](http://plnkr.co/edit/cziMAy?p=preview)\\nAccess the results with `apingResults.valueName`\",\n    \"7-0\": \"`id-by`\",\n    \"8-0\": \"`merge-doubles`\",\n    \"7-1\": \"`string` or `json array`\",\n    \"8-1\": \"`boolean`\",\n    \"8-2\": \"`false`\",\n    \"7-2\": \"`intern_id`\\n`['name','date']`\\n`['user.0','user.1']`\",\n    \"7-3\": \"Create id for each item by this properties.\\nProperty name: `aping_id`\",\n    \"8-3\": \"Use `true` to merge objects with the same ID.\\nWorks only with `id-by`\\nDefault value: `false`\",\n    \"12-0\": \"`result-property`\",\n    \"12-1\": \"`string`\",\n    \"12-2\": \"`events`\",\n    \"12-3\": \"Change the `result-property` to set the \\n`$scope` property that will contain the results.\\nDefault value: `results`\"\n  },\n  \"cols\": 4,\n  \"rows\": 13\n}\n[/block]\n<br>\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Work in progress\",\n  \"body\": \"This page is under construction\"\n}\n[/block]","excerpt":"","slug":"advanced","type":"basic","title":"Advanced Usage"}
**By combining the basic and advanced features, apiNG turns into a rocket.** It's nothing less than an extendable platform, where users can collaborate to create new plugins and designs. [block:callout] { "type": "success", "body": "Social Wall: http://plnkr.co/edit/dz3Dru?p=preview", "title": "Plnklr demo (view & edit)" } [/block] [block:api-header] { "type": "basic", "title": "Table of Content" } [/block] * **[Components](#components)** * **[Credential Manager](#credential-manager)** * **[Parameters](#parameters)** <br> [block:api-header] { "type": "basic", "title": "Components" } [/block] By using this **components**, you are able to use and create re-usable modules for your work with AngularJS. ## Plugins **[apiNG Plugins](plugins) work as data sources for specific platforms or protocols** (e.g. Facebook, Youtube, RSS, GitHub, ...) * Plugins are easy to configure * Plugins could return data in two ways: 1. as **native** data 2. as **converted** data, transformed into several universal data _models_ (e.g. for images, videos, events, ...) * Use **[existing plugins](all-plugins)** * [Create your own plugin](plugins#create-new-aping-plugins) ## Models **[apiNG Models](models) are universal data models** (e.g. for images, videos, events, social media, ...) * Models could be created or changed, just by doing it. ## Designs **[apiNG Designs](designs) are templates to display specific _models_** * Use [existing designs](all-designs) * [Create your own design](designs) <br> [block:api-header] { "type": "basic", "title": "Credential Manager" } [/block] The **credential manager** is a functionality of apiNG, written to relieve working with plugins, if they have to deal with api keys, access tokens, and other credentials. :fa-key: **Copy & paste your credentials for your requests into the [config file](configuration)**. You can store this config file on your webspace and re-use this credentials for some projects. [block:code] { "codes": [ { "code": "apingApiKeys: {\n youtube : [{'apiKey': '<YOUR_YOUTUBE_API_KEY>'}],\n facebook: [{'access_token': '<YOUR_FACEBOOK_TOKEN>'}],\n twitter: [{'bearer_token': '<YOUR_TWITTER_BEARER_TOKEN>'}],\n vimeo: [{'access_token': '<YOUR_VIMEO_TOKEN>'}],\n tumblr: [{'api_key': '<YOUR_TUMBLR_API_KEY>'}],\n // ...\n}", "language": "javascript" } ] } [/block] <hr>:fa-key: **Every plugin could be authorized with a credential object:** [block:code] { "codes": [ { "code": "apingApiKeys: {\n instagram : [{\n 'api_key': '<YOUR_API_KEY>',\n 'client_id': '<YOUR_CLIENT_ID>'\n }],\n // ...\n}", "language": "javascript" } ] } [/block] <hr>:fa-key: **You can store multiple credentials objects _per plugin_ to bypass rate limitations.** The used credential object will get chosen randomly. [block:code] { "codes": [ { "code": "apingApiKeys: {\n facebook : [\n { 'access_token': '<YOUR_ACCESS_TOKEN_1>'},\n { 'access_token': '<YOUR_ACCESS_TOKEN_2>'},\n { 'access_token': '<YOUR_ACCESS_TOKEN_3>'},\n { 'access_token': '<YOUR_ACCESS_TOKEN_4>'}\n ],\n // ...\n}", "language": "javascript" } ] } [/block] <br> [block:api-header] { "type": "basic", "title": "Parameters" } [/block] For advanced usage, there are two additional parameters for apiNG (bold): [block:parameters] { "data": { "0-0": "`template-url`", "h-0": "Attribute", "h-1": "Type", "h-2": "Sample", "h-3": "Description", "h-4": "Opt.", "0-1": "`string`", "0-2": "`template.html`", "0-3": "Path to template file.\nUse result data in template with `{{results}}`", "0-4": "**no**", "1-0": "**`model`**", "1-1": "**`string`**", "1-2": "**`social`**", "1-3": "**Chosen data model for this _apiNG instance_**", "1-4": "yes", "2-0": "**`get-native-data`**", "2-1": "**`boolean`**", "2-2": "**`false`**", "2-3": "**Use `true` for getting native data from plugins.\nDefault value:`false`**", "2-4": "yes", "3-0": "`items`", "3-1": "`int`", "3-2": "`20`", "3-3": "Number of displayed items per request", "3-4": "yes", "4-0": "`max-items`", "4-1": "`int`", "4-2": "`100`", "4-3": "Number of items of this apiNG instance.\nUse `-1` for no limitation", "4-4": "yes", "5-0": "`order-by`", "5-1": "`string`", "5-2": "`timestamp`", "5-3": "Order result by this attribute.\nUse `$NONE` for no order.\nUse `$RANDOM` for random order", "5-4": "yes", "6-0": "`order-reverse`", "6-1": "`boolean`", "6-2": "`false`", "6-3": "Use `true` for reverse order.\nDefault value: `false`", "6-4": "yes", "9-0": "`remove-doubles`", "9-1": "`boolean`", "9-2": "`false`", "9-3": "Use `true` to remove identical objects\nor with the same ID (`id-by`).\nGets ignored if `merge-doubles` is set.\nDefault value: `false`", "9-4": "yes", "10-0": "`payload-json`", "10-1": "`json object`", "10-2": "`{'key1':'value1'}`", "10-3": "Inject additional payload data into your template.\nUse payload data in template with `{{payload}}`", "10-4": "yes", "11-0": "`value-name`", "11-1": "`string`", "11-2": "`videos`", "11-3": "Inject `apingResults` into your app. [(Plnkr)](http://plnkr.co/edit/cziMAy?p=preview)\nAccess the results with `apingResults.valueName`", "7-0": "`id-by`", "8-0": "`merge-doubles`", "7-1": "`string` or `json array`", "8-1": "`boolean`", "8-2": "`false`", "7-2": "`intern_id`\n`['name','date']`\n`['user.0','user.1']`", "7-3": "Create id for each item by this properties.\nProperty name: `aping_id`", "8-3": "Use `true` to merge objects with the same ID.\nWorks only with `id-by`\nDefault value: `false`", "12-0": "`result-property`", "12-1": "`string`", "12-2": "`events`", "12-3": "Change the `result-property` to set the \n`$scope` property that will contain the results.\nDefault value: `results`" }, "cols": 4, "rows": 13 } [/block] <br> [block:callout] { "type": "warning", "title": "Work in progress", "body": "This page is under construction" } [/block]