{"__v":37,"_id":"553f92926a7d010d0057c85a","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"## Welcome\n\nThis Getting Started guide will show you how to implement a news feed in your app using the powerful Tapglue API. Our detailed reference documentation will then help you to build the perfect use case for *your* application. \n\nBefore we jump into the implementation, here is a simple example of what a news feed built with the Tapglue API could look like:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/5biAq3RCTvOxk4XrW37K\",\n        \"Newsfeed.png\",\n        \"290\",\n        \"515\",\n        \"#88b832\",\n        \"\"\n      ],\n      \"caption\": \"\"\n    }\n  ]\n}\n[/block]\nUsing the Tapglue API makes it super easy to build these kind of experiences. To get you started we have created a quick guide that will show you how to: \n\n  * create users\n  * login users\n  * connect users\n  * send events  \n  * display the newsfeed \n\nThese simple steps are the basis to create great use cases on top of our API, build your own community and provide a rich social experience to your users. \n\nOur API was designed to provide you with the best possible flexibility. You can enrich your news feed with metadata or deep links that send users to specific objects. \n\nWe have built a highly scalable system with state of the art technology so you don't have to worry about handling servers. We want to enable you to build the best possible user experience and let you focus on your growth.\n\n## Create application\n\nTo start using the Tapglue API you need an `APP_TOKEN`. Visit our [Dashboard](https://beta.tapglue.com) and login with the credentials you have received from us. If you don't have a Tapglue account yet, please [get in touch](mailto:contact@tapglue.com). \n\nCreate an application by selecting **Add Application** on the top left.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/NujRPlSQYCU5X1MEOsw1\",\n        \"App1.png\",\n        \"802\",\n        \"222\",\n        \"#404148\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nEnter an **Application Name** and a brief **Description**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/98i25vHNScGhUyfvQjrw\",\n        \"App2.png\",\n        \"802\",\n        \"222\",\n        \"#4a4b4b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThe application will now appear in the application overview of your dashboard.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/4h877vftRIGIQlWfFzGg\",\n        \"App3.png\",\n        \"802\",\n        \"222\",\n        \"#3c3d44\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nSelect **Show Token** to access your `APP_TOKEN`.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/dpL095A9SSSBFhDB87u6\",\n        \"App4.png\",\n        \"802\",\n        \"222\",\n        \"#4a4a4a\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThis access token enables you to start using the Tapglue API. You are now ready to do your first requests and create users.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Secure Tokens\",\n  \"body\": \"It is essential that you secure your tokens and not expose it to others. \\nSee it as your applications password for Tapglue.\"\n}\n[/block]","category":"553f925123c53c0d00cccd3f","createdAt":"2015-04-28T14:00:50.930Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"5538be9dfd56310d00b173d0","slug":"introduction","sync_unique":"","title":"Introduction","type":"basic","updates":["5547ba54d3427d0d00cd6e00","55488cebafc5ed0d00e1451e"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Introduction


## Welcome This Getting Started guide will show you how to implement a news feed in your app using the powerful Tapglue API. Our detailed reference documentation will then help you to build the perfect use case for *your* application. Before we jump into the implementation, here is a simple example of what a news feed built with the Tapglue API could look like: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/5biAq3RCTvOxk4XrW37K", "Newsfeed.png", "290", "515", "#88b832", "" ], "caption": "" } ] } [/block] Using the Tapglue API makes it super easy to build these kind of experiences. To get you started we have created a quick guide that will show you how to: * create users * login users * connect users * send events * display the newsfeed These simple steps are the basis to create great use cases on top of our API, build your own community and provide a rich social experience to your users. Our API was designed to provide you with the best possible flexibility. You can enrich your news feed with metadata or deep links that send users to specific objects. We have built a highly scalable system with state of the art technology so you don't have to worry about handling servers. We want to enable you to build the best possible user experience and let you focus on your growth. ## Create application To start using the Tapglue API you need an `APP_TOKEN`. Visit our [Dashboard](https://beta.tapglue.com) and login with the credentials you have received from us. If you don't have a Tapglue account yet, please [get in touch](mailto:contact@tapglue.com). Create an application by selecting **Add Application** on the top left. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/NujRPlSQYCU5X1MEOsw1", "App1.png", "802", "222", "#404148", "" ] } ] } [/block] Enter an **Application Name** and a brief **Description**. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/98i25vHNScGhUyfvQjrw", "App2.png", "802", "222", "#4a4b4b", "" ] } ] } [/block] The application will now appear in the application overview of your dashboard. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/4h877vftRIGIQlWfFzGg", "App3.png", "802", "222", "#3c3d44", "" ] } ] } [/block] Select **Show Token** to access your `APP_TOKEN`. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/dpL095A9SSSBFhDB87u6", "App4.png", "802", "222", "#4a4a4a", "" ] } ] } [/block] This access token enables you to start using the Tapglue API. You are now ready to do your first requests and create users. [block:callout] { "type": "danger", "title": "Secure Tokens", "body": "It is essential that you secure your tokens and not expose it to others. \nSee it as your applications password for Tapglue." } [/block]
## Welcome This Getting Started guide will show you how to implement a news feed in your app using the powerful Tapglue API. Our detailed reference documentation will then help you to build the perfect use case for *your* application. Before we jump into the implementation, here is a simple example of what a news feed built with the Tapglue API could look like: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/5biAq3RCTvOxk4XrW37K", "Newsfeed.png", "290", "515", "#88b832", "" ], "caption": "" } ] } [/block] Using the Tapglue API makes it super easy to build these kind of experiences. To get you started we have created a quick guide that will show you how to: * create users * login users * connect users * send events * display the newsfeed These simple steps are the basis to create great use cases on top of our API, build your own community and provide a rich social experience to your users. Our API was designed to provide you with the best possible flexibility. You can enrich your news feed with metadata or deep links that send users to specific objects. We have built a highly scalable system with state of the art technology so you don't have to worry about handling servers. We want to enable you to build the best possible user experience and let you focus on your growth. ## Create application To start using the Tapglue API you need an `APP_TOKEN`. Visit our [Dashboard](https://beta.tapglue.com) and login with the credentials you have received from us. If you don't have a Tapglue account yet, please [get in touch](mailto:contact@tapglue.com). Create an application by selecting **Add Application** on the top left. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/NujRPlSQYCU5X1MEOsw1", "App1.png", "802", "222", "#404148", "" ] } ] } [/block] Enter an **Application Name** and a brief **Description**. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/98i25vHNScGhUyfvQjrw", "App2.png", "802", "222", "#4a4b4b", "" ] } ] } [/block] The application will now appear in the application overview of your dashboard. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/4h877vftRIGIQlWfFzGg", "App3.png", "802", "222", "#3c3d44", "" ] } ] } [/block] Select **Show Token** to access your `APP_TOKEN`. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/dpL095A9SSSBFhDB87u6", "App4.png", "802", "222", "#4a4a4a", "" ] } ] } [/block] This access token enables you to start using the Tapglue API. You are now ready to do your first requests and create users. [block:callout] { "type": "danger", "title": "Secure Tokens", "body": "It is essential that you secure your tokens and not expose it to others. \nSee it as your applications password for Tapglue." } [/block]
{"__v":30,"_id":"553f83a06a7d010d0057c81d","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"The user object is the essential piece of the news feed. User interactions with your application drive activity and updates in the news feed. \n\nOur API is highly flexible and lets you decide which user information you store at Tapglue. It could be as simple as just storing a `custom_id` or more sophisticated storing rich user profiles. You can use your existing user database and just utilize our API as an extension of your backend or let Tapglue cover your whole user management. \n\nLet's start with our dummy user Marc Miller:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/aLDQjmuPRoulrC6SrEy6\",\n        \"user.png\",\n        \"383\",\n        \"154\",\n        \"#5197df\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nTo register Marc as a new user at Tapglue run the following API call. Make sure to replace the `APP_TOKEN` with the one you received in our dashboard.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/users \\\\\\n    -u APP_TOKEN: \\\\\\n    -H 'Accept: application/json' \\\\\\n    -H 'Content-Type: application/json' \\\\\\n    -d '{\\\"custom_id\\\":\\\"1\\\", \\\"first_name\\\":\\\"Marc\\\", \\\"last_name\\\": \\\"Miller\\\", \\\"user_name\\\":\\\"marc\\\", \\\"email\\\": \\\"marc@mail.io\\\", \\\"url\\\": \\\"myapp://user/1\\\", \\\"password\\\":\\\"hashedPassword\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nYou just made your first request with Tapglue! If your call was correct you will receive a result like this:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"id\\\":1,\\n  \\t\\\"custom_id\\\":\\\"1\\\",\\n    \\\"first_name\\\":\\\"Marc\\\",\\n    \\\"last_name\\\":\\\"Miller\\\",\\n    \\\"user_name\\\":\\\"marc\\\",\\n    \\\"email\\\":\\\"marc@mail.io\\\",\\n    \\\"url\\\": \\\"myapp://user/1\\\",\\n    \\\"last_login\\\":\\\"0000-01-01T00:00:00Z\\\",\\n    \\\"enabled\\\":true,\\n    \\\"created_at\\\":\\\"2015-03-20T18:15:40.889+01:00\\\",\\n    \\\"updated_at\\\":\\\"2015-03-20T18:15:40.890+01:00\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe user has been created in our backend. Store that information in a native object of the environment you are in.\n\nA single user doesn't make a network. Let's create some more so we can proceed with our guide:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/users \\\\\\n    -u APP_TOKEN: \\\\\\n    -H 'Accept: application/json' \\\\\\n    -H 'Content-Type: application/json' \\\\\\n    -d '{\\\"custom_id\\\":\\\"2\\\", \\\"first_name\\\":\\\"Neal\\\", \\\"last_name\\\": \\\"Smith\\\", \\\"user_name\\\":\\\"neal\\\", \\\"email\\\": \\\"neal@mail.io\\\", \\\"url\\\": \\\"myapp://user/2\\\", \\\"password\\\":\\\"hashedPassword\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/users \\\\\\n    -u APP_TOKEN: \\\\\\n    -H 'Accept: application/json' \\\\\\n    -H 'Content-Type: application/json' \\\\\\n    -d '{\\\"custom_id\\\":\\\"3\\\", \\\"first_name\\\":\\\"Lisa\\\", \\\"last_name\\\": \\\"Thomson\\\", \\\"user_name\\\":\\\"lisa\\\", \\\"email\\\": \\\"lisa@mail.io\\\", \\\"url\\\": \\\"myapp://user/3\\\", \\\"password\\\":\\\"hashedPassword\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nThree users have been created so you are ready to proceed with creating connections.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Hash Passwords\",\n  \"body\": \"In order to authenticate the users and retrieve a `SESSION_TOKEN` you need to send a password. Please make sure to consistently hash the passwords before sending them to us.\\n\\nWe use a secure connection and hash passwords on our side before storing storing them however it is a good practice to send hashed passwords over the Internet.\"\n}\n[/block]","category":"553f925123c53c0d00cccd3f","createdAt":"2015-04-27T15:28:11.057Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"5538be9dfd56310d00b173d0","slug":"create-users","sync_unique":"","title":"Create Users","type":"basic","updates":["55488efdd2c8410d006c21c7"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Create Users


The user object is the essential piece of the news feed. User interactions with your application drive activity and updates in the news feed. Our API is highly flexible and lets you decide which user information you store at Tapglue. It could be as simple as just storing a `custom_id` or more sophisticated storing rich user profiles. You can use your existing user database and just utilize our API as an extension of your backend or let Tapglue cover your whole user management. Let's start with our dummy user Marc Miller: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/aLDQjmuPRoulrC6SrEy6", "user.png", "383", "154", "#5197df", "" ] } ] } [/block] To register Marc as a new user at Tapglue run the following API call. Make sure to replace the `APP_TOKEN` with the one you received in our dashboard. [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/users \\\n -u APP_TOKEN: \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\"custom_id\":\"1\", \"first_name\":\"Marc\", \"last_name\": \"Miller\", \"user_name\":\"marc\", \"email\": \"marc@mail.io\", \"url\": \"myapp://user/1\", \"password\":\"hashedPassword\"}'", "language": "curl" } ] } [/block] You just made your first request with Tapglue! If your call was correct you will receive a result like this: [block:code] { "codes": [ { "code": "{\n \"id\":1,\n \t\"custom_id\":\"1\",\n \"first_name\":\"Marc\",\n \"last_name\":\"Miller\",\n \"user_name\":\"marc\",\n \"email\":\"marc@mail.io\",\n \"url\": \"myapp://user/1\",\n \"last_login\":\"0000-01-01T00:00:00Z\",\n \"enabled\":true,\n \"created_at\":\"2015-03-20T18:15:40.889+01:00\",\n \"updated_at\":\"2015-03-20T18:15:40.890+01:00\"\n}", "language": "json" } ] } [/block] The user has been created in our backend. Store that information in a native object of the environment you are in. A single user doesn't make a network. Let's create some more so we can proceed with our guide: [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/users \\\n -u APP_TOKEN: \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\"custom_id\":\"2\", \"first_name\":\"Neal\", \"last_name\": \"Smith\", \"user_name\":\"neal\", \"email\": \"neal@mail.io\", \"url\": \"myapp://user/2\", \"password\":\"hashedPassword\"}'", "language": "curl" } ] } [/block] [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/users \\\n -u APP_TOKEN: \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\"custom_id\":\"3\", \"first_name\":\"Lisa\", \"last_name\": \"Thomson\", \"user_name\":\"lisa\", \"email\": \"lisa@mail.io\", \"url\": \"myapp://user/3\", \"password\":\"hashedPassword\"}'", "language": "curl" } ] } [/block] Three users have been created so you are ready to proceed with creating connections. [block:callout] { "type": "info", "title": "Hash Passwords", "body": "In order to authenticate the users and retrieve a `SESSION_TOKEN` you need to send a password. Please make sure to consistently hash the passwords before sending them to us.\n\nWe use a secure connection and hash passwords on our side before storing storing them however it is a good practice to send hashed passwords over the Internet." } [/block]
The user object is the essential piece of the news feed. User interactions with your application drive activity and updates in the news feed. Our API is highly flexible and lets you decide which user information you store at Tapglue. It could be as simple as just storing a `custom_id` or more sophisticated storing rich user profiles. You can use your existing user database and just utilize our API as an extension of your backend or let Tapglue cover your whole user management. Let's start with our dummy user Marc Miller: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/aLDQjmuPRoulrC6SrEy6", "user.png", "383", "154", "#5197df", "" ] } ] } [/block] To register Marc as a new user at Tapglue run the following API call. Make sure to replace the `APP_TOKEN` with the one you received in our dashboard. [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/users \\\n -u APP_TOKEN: \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\"custom_id\":\"1\", \"first_name\":\"Marc\", \"last_name\": \"Miller\", \"user_name\":\"marc\", \"email\": \"marc@mail.io\", \"url\": \"myapp://user/1\", \"password\":\"hashedPassword\"}'", "language": "curl" } ] } [/block] You just made your first request with Tapglue! If your call was correct you will receive a result like this: [block:code] { "codes": [ { "code": "{\n \"id\":1,\n \t\"custom_id\":\"1\",\n \"first_name\":\"Marc\",\n \"last_name\":\"Miller\",\n \"user_name\":\"marc\",\n \"email\":\"marc@mail.io\",\n \"url\": \"myapp://user/1\",\n \"last_login\":\"0000-01-01T00:00:00Z\",\n \"enabled\":true,\n \"created_at\":\"2015-03-20T18:15:40.889+01:00\",\n \"updated_at\":\"2015-03-20T18:15:40.890+01:00\"\n}", "language": "json" } ] } [/block] The user has been created in our backend. Store that information in a native object of the environment you are in. A single user doesn't make a network. Let's create some more so we can proceed with our guide: [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/users \\\n -u APP_TOKEN: \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\"custom_id\":\"2\", \"first_name\":\"Neal\", \"last_name\": \"Smith\", \"user_name\":\"neal\", \"email\": \"neal@mail.io\", \"url\": \"myapp://user/2\", \"password\":\"hashedPassword\"}'", "language": "curl" } ] } [/block] [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/users \\\n -u APP_TOKEN: \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\"custom_id\":\"3\", \"first_name\":\"Lisa\", \"last_name\": \"Thomson\", \"user_name\":\"lisa\", \"email\": \"lisa@mail.io\", \"url\": \"myapp://user/3\", \"password\":\"hashedPassword\"}'", "language": "curl" } ] } [/block] Three users have been created so you are ready to proceed with creating connections. [block:callout] { "type": "info", "title": "Hash Passwords", "body": "In order to authenticate the users and retrieve a `SESSION_TOKEN` you need to send a password. Please make sure to consistently hash the passwords before sending them to us.\n\nWe use a secure connection and hash passwords on our side before storing storing them however it is a good practice to send hashed passwords over the Internet." } [/block]
{"__v":7,"_id":"5548c67cafc5ed0d00e145b0","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Security was a big focussed when we designed the Tapglue API. Therefore a `SESSION_TOKEN` is always required in order to create user connections, send events or receive feeds.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Session Token\",\n  \"body\": \"Every request (except creating users) requires a valid `SESSION_TOKEN` in the HTTP Basic Authentication as the password. Use our user management and we will provide it to you after you login the user.\"\n}\n[/block]\nTo receive the session token simply create a request against our login endpoint with the correct user credentials you have created in the steps before. In the following example, we login Lisa:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/user/login \\\\\\n    -u APP_TOKEN: \\\\\\n    -H 'Accept: application/json' \\\\\\n    -H \\\"Content-Type: application/json\\\" \\\\\\n    -d '{\\\"email\\\":\\\"lisa@mail.io\\\", \\\"password\\\":\\\"hashedPassword\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nHere is the correct response that provides you with the users id and session token:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"id\\\":\\\"ca16872c-60de-5696-a6b0-1d497b8a18f5\\\",\\n    \\\"session_token\\\":\\\"sad3dasd3as2kj520jsdaxhj23ivcbvsyc=\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nStore the session token securely and continue with establishing user connections.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Authentication\",\n  \"body\": \"The easiest and recommended way to get started with our API is to login all users via Tapglue. If you already have a rich user management and want to authenticate users from your backend check the [Authentication](doc:authentication) section for more details.\"\n}\n[/block]","category":"553f925123c53c0d00cccd3f","createdAt":"2015-05-05T13:32:44.561Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"project":"5538be9dfd56310d00b173d0","slug":"authenticate-users","sync_unique":"","title":"Authenticate Users","type":"basic","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Authenticate Users


Security was a big focussed when we designed the Tapglue API. Therefore a `SESSION_TOKEN` is always required in order to create user connections, send events or receive feeds. [block:callout] { "type": "info", "title": "Session Token", "body": "Every request (except creating users) requires a valid `SESSION_TOKEN` in the HTTP Basic Authentication as the password. Use our user management and we will provide it to you after you login the user." } [/block] To receive the session token simply create a request against our login endpoint with the correct user credentials you have created in the steps before. In the following example, we login Lisa: [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/login \\\n -u APP_TOKEN: \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{\"email\":\"lisa@mail.io\", \"password\":\"hashedPassword\"}'", "language": "curl" } ] } [/block] Here is the correct response that provides you with the users id and session token: [block:code] { "codes": [ { "code": "{\n \"id\":\"ca16872c-60de-5696-a6b0-1d497b8a18f5\",\n \"session_token\":\"sad3dasd3as2kj520jsdaxhj23ivcbvsyc=\"\n}", "language": "json" } ] } [/block] Store the session token securely and continue with establishing user connections. [block:callout] { "type": "info", "title": "Authentication", "body": "The easiest and recommended way to get started with our API is to login all users via Tapglue. If you already have a rich user management and want to authenticate users from your backend check the [Authentication](doc:authentication) section for more details." } [/block]
Security was a big focussed when we designed the Tapglue API. Therefore a `SESSION_TOKEN` is always required in order to create user connections, send events or receive feeds. [block:callout] { "type": "info", "title": "Session Token", "body": "Every request (except creating users) requires a valid `SESSION_TOKEN` in the HTTP Basic Authentication as the password. Use our user management and we will provide it to you after you login the user." } [/block] To receive the session token simply create a request against our login endpoint with the correct user credentials you have created in the steps before. In the following example, we login Lisa: [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/login \\\n -u APP_TOKEN: \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{\"email\":\"lisa@mail.io\", \"password\":\"hashedPassword\"}'", "language": "curl" } ] } [/block] Here is the correct response that provides you with the users id and session token: [block:code] { "codes": [ { "code": "{\n \"id\":\"ca16872c-60de-5696-a6b0-1d497b8a18f5\",\n \"session_token\":\"sad3dasd3as2kj520jsdaxhj23ivcbvsyc=\"\n}", "language": "json" } ] } [/block] Store the session token securely and continue with establishing user connections. [block:callout] { "type": "info", "title": "Authentication", "body": "The easiest and recommended way to get started with our API is to login all users via Tapglue. If you already have a rich user management and want to authenticate users from your backend check the [Authentication](doc:authentication) section for more details." } [/block]
{"__v":38,"_id":"553f83a06a7d010d0057c819","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"## Social Graph\n\nBy connecting users with each other you are building a social graph in your app. User connections are essential to provide a social experience. There are two basic concepts of user connections: Friends and Followers. The Tapglue API covers both models. For this guide we will proceed with an example for the Follower concept.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Friend vs Follower\",\n  \"body\": \"Picking the right user connection model for your app is important.\\n\\nThe Friends model means two users are mutually connected with each other. The most popular example for the Friends model is Facebook. \\n\\nThe follower model serves better for more public networks as there are often one-directional connections between users. The most famous network for this model is Twitter: Everybody can follow everybody through a public profile page.\"\n}\n[/block]\n## Follower Model\n\nIn the following steps we are going to build a small social graph using the follower model. We will establish follower connections between our three users Marc, Lisa and Neal.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/bGTCzNfhQh2o1WA52P6j\",\n        \"follow.png\",\n        \"198\",\n        \"188\",\n        \"#b45387\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nAccording to the picture above we will create four connections in total:\n\n  * Lisa follows Marc\n  * Lisa follows Neal\n  * Marc follows Lisa\n  * Neal follows Marc\n\n## Create Connections\n\nThe first connection will be triggered by Lisa starting to follow Marc. In order to find other users our api allows search queries. Try to to search for Marc:\n\n**Lisa searches for Marc**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/users/search?q=marc \\\\\\n    -u APP_TOKEN:SESSION_TOKEN \\\\\\n    -H 'Accept: application/json'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nBy default we search in the users username, first name, last name and email for the term `marc`. The result appears as follow:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n   {\\n    \\\"id\\\":\\\"1\\\",\\n    \\\"custom_id\\\":\\\"1\\\",\\n    \\\"first_name\\\":\\\"Marc\\\",\\n    \\\"last_name\\\":\\\"Miller\\\",\\n    \\\"user_name\\\":\\\"marc\\\",\\n    \\\"email\\\":\\\"marc@mail.io\\\",\\n    \\\"url\\\": \\\"myapp://user/1\\\",\\n    \\\"last_login\\\":\\\"0000-01-01T00:00:00Z\\\",\\n    \\\"enabled\\\":true,\\n    \\\"created_at\\\":\\\"2015-03-20T18:15:40.889+01:00\\\",\\n    \\\"updated_at\\\":\\\"2015-03-20T18:15:40.890+01:00\\\"\\n\\t}\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nNow that we have the ids of Marc, we can go ahead and create the connections.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Authenticate Users\",\n  \"body\": \"Keep in mind that, before creating connections, sending events and receiving feeds you need to authenticate the user. That process is described in the [Authenticate Users](doc:authenticate-users) section.\"\n}\n[/block]\n**Lisa starts following Marc**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/user/connections \\\\\\n    -u APP_TOKEN:SESSION_TOKEN \\\\\\n    -H 'Accept: application/json' \\\\\\n    -H \\\"Content-Type: application/json\\\" \\\\\\n    -d '{\\\"user_to_id\\\":USER_ID, \\\"type\\\":\\\"follow\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nNow, this should result in:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"user_from_id\\\":\\\"3\\\",\\n    \\\"user_to_id\\\":\\\"1\\\",\\n    \\\"type\\\":\\\"follow\\\",\\n    \\\"enabled\\\":true,\\n    \\\"created_at\\\":\\\"2015-03-21T09:22:10.918+01:00\\\",\\n    \\\"updated_at\\\":\\\"2015-03-21T09:22:10.324+01:00\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n**Lisa starts following Neal**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/user/connections \\\\\\n    -u APP_TOKEN:SESSION_TOKEN \\\\\\n    -H 'Accept: application/json' \\\\\\n    -H \\\"Content-Type: application/json\\\" \\\\\\n    -d '{\\\"user_to_id\\\":USER_ID, \\\"type\\\":\\\"follow\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n**Marc starts following Lisa**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/user/connections \\\\\\n    -u APP_TOKEN:SESSION_TOKEN \\\\\\n    -H 'Accept: application/json' \\\\\\n    -H \\\"Content-Type: application/json\\\" \\\\\\n    -d '{\\\"user_to_id\\\":2, \\\"type\\\":\\\"follow\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n**Neal starts following Marc**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/user/connections \\\\\\n    -u APP_TOKEN:SESSION_TOKEN \\\\\\n    -H 'Accept: application/json' \\\\\\n    -H \\\"Content-Type: application/json\\\" \\\\\\n    -d '{\\\"user_to_id\\\":1, \\\"type\\\":\\\"follow\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nVoilà! All connections of our example social graph have been created. \n\n## Retrieve Followers\n\nYou are now ready to show Marc all users he is followed by. To retrieve the followers perform the following request:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/user/followers \\\\\\n    -u APP_TOKEN:SESSION_TOKEN \\\\\\n    -H 'Accept: application/json' \\\\\\n    -H \\\"Content-Type: application/json\\\"\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nYou will receive the list of followers as an array:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n    {\\n        \\\"id\\\":\\\"2\\\",\\n      \\t\\\"custom_id\\\":\\\"2\\\",\\n        \\\"user_name\\\":\\\"neal\\\",\\n        \\\"first_name\\\":\\\"Neal\\\",\\n        \\\"last_name\\\":\\\"Smith\\\",\\n        \\\"email\\\":\\\"neal@mail.o\\\",\\n      \\t\\\"url\\\": \\\"myapp://user/2\\\",\\n        \\\"last_login\\\":\\\"2015-03-18T11:09:49.443+01:00\\\",\\n        \\\"enabled\\\":true,\\n        \\\"created_at\\\":\\\"2015-03-18T11:07:42.3168+01:00\\\",\\n        \\\"updated_at\\\":\\\"2015-03-18T11:07:42.4368+01:00\\\"\\n    },\\n    {\\n        \\\"id\\\":\\\"3\\\",\\n      \\t\\\"custom_id\\\": \\\"3\\\",\\n        \\\"user_name\\\":\\\"lisa\\\",\\n        \\\"first_name\\\":\\\"Lisa\\\",\\n        \\\"last_name\\\":\\\"Thomson\\\",\\n        \\\"email\\\":\\\"lisa@mail.o\\\",\\n      \\t\\\"url\\\": \\\"myapp://user/3\\\",\\n        \\\"last_login\\\":\\\"2015-03-18T11:09:49.443+01:00\\\",\\n        \\\"enabled\\\":true,\\n        \\\"created_at\\\":\\\"2015-03-18T11:07:42.3168+01:00\\\",\\n        \\\"updated_at\\\":\\\"2015-03-18T11:07:42.4368+01:00\\\"\\n    },\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nWe now have users and connections. The only thing left before we can display the news feed is sending some events for those users.","category":"553f925123c53c0d00cccd3f","createdAt":"2015-04-23T10:00:49.823Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"project":"5538be9dfd56310d00b173d0","slug":"connect-users","sync_unique":"","title":"Connect Users","type":"basic","updates":["55489002b2581a0d0091405f"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Connect Users


## Social Graph By connecting users with each other you are building a social graph in your app. User connections are essential to provide a social experience. There are two basic concepts of user connections: Friends and Followers. The Tapglue API covers both models. For this guide we will proceed with an example for the Follower concept. [block:callout] { "type": "info", "title": "Friend vs Follower", "body": "Picking the right user connection model for your app is important.\n\nThe Friends model means two users are mutually connected with each other. The most popular example for the Friends model is Facebook. \n\nThe follower model serves better for more public networks as there are often one-directional connections between users. The most famous network for this model is Twitter: Everybody can follow everybody through a public profile page." } [/block] ## Follower Model In the following steps we are going to build a small social graph using the follower model. We will establish follower connections between our three users Marc, Lisa and Neal. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/bGTCzNfhQh2o1WA52P6j", "follow.png", "198", "188", "#b45387", "" ] } ] } [/block] According to the picture above we will create four connections in total: * Lisa follows Marc * Lisa follows Neal * Marc follows Lisa * Neal follows Marc ## Create Connections The first connection will be triggered by Lisa starting to follow Marc. In order to find other users our api allows search queries. Try to to search for Marc: **Lisa searches for Marc** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/users/search?q=marc \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json'", "language": "curl" } ] } [/block] By default we search in the users username, first name, last name and email for the term `marc`. The result appears as follow: [block:code] { "codes": [ { "code": "[\n {\n \"id\":\"1\",\n \"custom_id\":\"1\",\n \"first_name\":\"Marc\",\n \"last_name\":\"Miller\",\n \"user_name\":\"marc\",\n \"email\":\"marc@mail.io\",\n \"url\": \"myapp://user/1\",\n \"last_login\":\"0000-01-01T00:00:00Z\",\n \"enabled\":true,\n \"created_at\":\"2015-03-20T18:15:40.889+01:00\",\n \"updated_at\":\"2015-03-20T18:15:40.890+01:00\"\n\t}\n]", "language": "json" } ] } [/block] Now that we have the ids of Marc, we can go ahead and create the connections. [block:callout] { "type": "info", "title": "Authenticate Users", "body": "Keep in mind that, before creating connections, sending events and receiving feeds you need to authenticate the user. That process is described in the [Authenticate Users](doc:authenticate-users) section." } [/block] **Lisa starts following Marc** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/connections \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{\"user_to_id\":USER_ID, \"type\":\"follow\"}'", "language": "curl" } ] } [/block] Now, this should result in: [block:code] { "codes": [ { "code": "{\n \"user_from_id\":\"3\",\n \"user_to_id\":\"1\",\n \"type\":\"follow\",\n \"enabled\":true,\n \"created_at\":\"2015-03-21T09:22:10.918+01:00\",\n \"updated_at\":\"2015-03-21T09:22:10.324+01:00\"\n}", "language": "json" } ] } [/block] **Lisa starts following Neal** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/connections \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{\"user_to_id\":USER_ID, \"type\":\"follow\"}'", "language": "curl" } ] } [/block] **Marc starts following Lisa** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/connections \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{\"user_to_id\":2, \"type\":\"follow\"}'", "language": "curl" } ] } [/block] **Neal starts following Marc** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/connections \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{\"user_to_id\":1, \"type\":\"follow\"}'", "language": "curl" } ] } [/block] Voilà! All connections of our example social graph have been created. ## Retrieve Followers You are now ready to show Marc all users he is followed by. To retrieve the followers perform the following request: [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/followers \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\"", "language": "curl" } ] } [/block] You will receive the list of followers as an array: [block:code] { "codes": [ { "code": "[\n {\n \"id\":\"2\",\n \t\"custom_id\":\"2\",\n \"user_name\":\"neal\",\n \"first_name\":\"Neal\",\n \"last_name\":\"Smith\",\n \"email\":\"neal@mail.o\",\n \t\"url\": \"myapp://user/2\",\n \"last_login\":\"2015-03-18T11:09:49.443+01:00\",\n \"enabled\":true,\n \"created_at\":\"2015-03-18T11:07:42.3168+01:00\",\n \"updated_at\":\"2015-03-18T11:07:42.4368+01:00\"\n },\n {\n \"id\":\"3\",\n \t\"custom_id\": \"3\",\n \"user_name\":\"lisa\",\n \"first_name\":\"Lisa\",\n \"last_name\":\"Thomson\",\n \"email\":\"lisa@mail.o\",\n \t\"url\": \"myapp://user/3\",\n \"last_login\":\"2015-03-18T11:09:49.443+01:00\",\n \"enabled\":true,\n \"created_at\":\"2015-03-18T11:07:42.3168+01:00\",\n \"updated_at\":\"2015-03-18T11:07:42.4368+01:00\"\n },\n]", "language": "json" } ] } [/block] We now have users and connections. The only thing left before we can display the news feed is sending some events for those users.
## Social Graph By connecting users with each other you are building a social graph in your app. User connections are essential to provide a social experience. There are two basic concepts of user connections: Friends and Followers. The Tapglue API covers both models. For this guide we will proceed with an example for the Follower concept. [block:callout] { "type": "info", "title": "Friend vs Follower", "body": "Picking the right user connection model for your app is important.\n\nThe Friends model means two users are mutually connected with each other. The most popular example for the Friends model is Facebook. \n\nThe follower model serves better for more public networks as there are often one-directional connections between users. The most famous network for this model is Twitter: Everybody can follow everybody through a public profile page." } [/block] ## Follower Model In the following steps we are going to build a small social graph using the follower model. We will establish follower connections between our three users Marc, Lisa and Neal. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/bGTCzNfhQh2o1WA52P6j", "follow.png", "198", "188", "#b45387", "" ] } ] } [/block] According to the picture above we will create four connections in total: * Lisa follows Marc * Lisa follows Neal * Marc follows Lisa * Neal follows Marc ## Create Connections The first connection will be triggered by Lisa starting to follow Marc. In order to find other users our api allows search queries. Try to to search for Marc: **Lisa searches for Marc** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/users/search?q=marc \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json'", "language": "curl" } ] } [/block] By default we search in the users username, first name, last name and email for the term `marc`. The result appears as follow: [block:code] { "codes": [ { "code": "[\n {\n \"id\":\"1\",\n \"custom_id\":\"1\",\n \"first_name\":\"Marc\",\n \"last_name\":\"Miller\",\n \"user_name\":\"marc\",\n \"email\":\"marc@mail.io\",\n \"url\": \"myapp://user/1\",\n \"last_login\":\"0000-01-01T00:00:00Z\",\n \"enabled\":true,\n \"created_at\":\"2015-03-20T18:15:40.889+01:00\",\n \"updated_at\":\"2015-03-20T18:15:40.890+01:00\"\n\t}\n]", "language": "json" } ] } [/block] Now that we have the ids of Marc, we can go ahead and create the connections. [block:callout] { "type": "info", "title": "Authenticate Users", "body": "Keep in mind that, before creating connections, sending events and receiving feeds you need to authenticate the user. That process is described in the [Authenticate Users](doc:authenticate-users) section." } [/block] **Lisa starts following Marc** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/connections \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{\"user_to_id\":USER_ID, \"type\":\"follow\"}'", "language": "curl" } ] } [/block] Now, this should result in: [block:code] { "codes": [ { "code": "{\n \"user_from_id\":\"3\",\n \"user_to_id\":\"1\",\n \"type\":\"follow\",\n \"enabled\":true,\n \"created_at\":\"2015-03-21T09:22:10.918+01:00\",\n \"updated_at\":\"2015-03-21T09:22:10.324+01:00\"\n}", "language": "json" } ] } [/block] **Lisa starts following Neal** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/connections \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{\"user_to_id\":USER_ID, \"type\":\"follow\"}'", "language": "curl" } ] } [/block] **Marc starts following Lisa** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/connections \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{\"user_to_id\":2, \"type\":\"follow\"}'", "language": "curl" } ] } [/block] **Neal starts following Marc** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/connections \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{\"user_to_id\":1, \"type\":\"follow\"}'", "language": "curl" } ] } [/block] Voilà! All connections of our example social graph have been created. ## Retrieve Followers You are now ready to show Marc all users he is followed by. To retrieve the followers perform the following request: [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/followers \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\"", "language": "curl" } ] } [/block] You will receive the list of followers as an array: [block:code] { "codes": [ { "code": "[\n {\n \"id\":\"2\",\n \t\"custom_id\":\"2\",\n \"user_name\":\"neal\",\n \"first_name\":\"Neal\",\n \"last_name\":\"Smith\",\n \"email\":\"neal@mail.o\",\n \t\"url\": \"myapp://user/2\",\n \"last_login\":\"2015-03-18T11:09:49.443+01:00\",\n \"enabled\":true,\n \"created_at\":\"2015-03-18T11:07:42.3168+01:00\",\n \"updated_at\":\"2015-03-18T11:07:42.4368+01:00\"\n },\n {\n \"id\":\"3\",\n \t\"custom_id\": \"3\",\n \"user_name\":\"lisa\",\n \"first_name\":\"Lisa\",\n \"last_name\":\"Thomson\",\n \"email\":\"lisa@mail.o\",\n \t\"url\": \"myapp://user/3\",\n \"last_login\":\"2015-03-18T11:09:49.443+01:00\",\n \"enabled\":true,\n \"created_at\":\"2015-03-18T11:07:42.3168+01:00\",\n \"updated_at\":\"2015-03-18T11:07:42.4368+01:00\"\n },\n]", "language": "json" } ] } [/block] We now have users and connections. The only thing left before we can display the news feed is sending some events for those users.
{"__v":28,"_id":"553f83a06a7d010d0057c81a","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Events represent the user interactions in your app that shall be displayed in the news feed. Picking relevant events to display in the news feed is an important conceptual exercise that you should do before implementation. \n\nFor our example we have defined two interactions that can be done on an objective (in our case a news article) and will serve as the event: Comment and Like\n\nHere is a draft of what the screen could look like:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/ISKkEC6RI2tEuAkaDKrO\",\n        \"Events.png\",\n        \"290\",\n        \"515\",\n        \"#6cb4b0\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThere are no limitation on which type of interaction fires an event or when this happens. We encourage you to think carefully about when to send the events, though. \n\nThe object (news article) our sample users will interact with has the following properties:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/PIPHa26gSWDuxD2TwvZ4\",\n        \"item.png\",\n        \"383\",\n        \"154\",\n        \"#5098e0\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Authenticate Users\",\n  \"body\": \"Keep in mind that, before creating connection or sending and receiving events you need to authenticate the users. That process is described in the [Authenticate Users](authenticate-users) section.\"\n}\n[/block]\n## Create events\n\nTime to send our two example events to the Tapglue API. We will send the following two events:\n\n  * Marc comments on the news article\n  * Neal likes the news article\n\nSince Lisa follows both Marc and Neal she will receive these two events in her news feed later.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/12FcyUaqSFmfU2OhRWWU\",\n        \"activity.png\",\n        \"215\",\n        \"181\",\n        \"#b9a586\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n**Marc comments on the News Article**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/user/events \\\\\\n    -u APP_TOKEN:SESSION_TOKEN \\\\\\n    -H 'Accept: application/json' \\\\\\n    -H \\\"Content-Type: application/json\\\" \\\\\\n    -d '{ \\\"verb\\\":\\\"comment\\\",\\n          \\\"object\\\":{\\n              \\\"id\\\":\\\"article_1\\\",\\n              \\\"type\\\":\\\"article\\\",\\n              \\\"url\\\":\\\"myapp://news/article_1\\\",\\n              \\\"display_name\\\":{\\n                  \\\"en\\\":\\\"Title of article\\\"\\n              }\\n          },\\n          \\\"metadata\\\":{\\n              \\\"category\\\":\\\"tech\\\"\\n          }\\n      }'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nYou will get back the event as JSON:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"id\\\":\\\"1\\\",\\n    \\\"user_id\\\":\\\"1\\\",\\n    \\\"verb\\\":\\\"comment\\\",\\n    \\\"object\\\":{\\n        \\\"id\\\":\\\"article_1\\\",\\n        \\\"type\\\":\\\"article\\\",\\n        \\\"display_name\\\":{\\n            \\\"en\\\":\\\"Title of article\\\"\\n        }\\n    },\\n    \\\"metadata\\\":{\\n        \\\"category\\\":\\\"tech\\\"\\n    },\\n    \\\"enabled\\\":true,\\n    \\\"created_at\\\":\\\"2015-03-21T14:28:02.432743827+01:00\\\",\\n    \\\"updated_at\\\":\\\"2015-03-21T14:28:02.432743827+01:00\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n**Neal likes the News Article**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/user/events \\\\\\n    -X POST \\\\\\n    -u APP_TOKEN:SESSION_TOKEN \\\\\\n    -H 'Accept: application/json' \\\\\\n    -H \\\"Content-Type: application/json\\\" \\\\\\n    -d '{ \\\"verb\\\":\\\"like\\\",\\n          \\\"object\\\":{\\n              \\\"id\\\":\\\"article_1\\\",\\n              \\\"type\\\":\\\"article\\\",\\n              \\\"url\\\":\\\"myapp://news/article_1\\\",\\n              \\\"display_name\\\":{\\n                  \\\"en\\\":\\\"Title of article\\\"\\n              }\\n          },\\n          \\\"metadata\\\":{\\n              \\\"category\\\":\\\"tech\\\"\\n          }\\n      }'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nSimple as that. These events can now be displayed to Lisa who is following Marc and Neal.","category":"553f925123c53c0d00cccd3f","createdAt":"2015-04-23T10:01:13.387Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":4,"project":"5538be9dfd56310d00b173d0","slug":"send-events","sync_unique":"","title":"Send Events","type":"basic","updates":["5548927dd2c8410d006c21d7"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Send Events


Events represent the user interactions in your app that shall be displayed in the news feed. Picking relevant events to display in the news feed is an important conceptual exercise that you should do before implementation. For our example we have defined two interactions that can be done on an objective (in our case a news article) and will serve as the event: Comment and Like Here is a draft of what the screen could look like: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/ISKkEC6RI2tEuAkaDKrO", "Events.png", "290", "515", "#6cb4b0", "" ] } ] } [/block] There are no limitation on which type of interaction fires an event or when this happens. We encourage you to think carefully about when to send the events, though. The object (news article) our sample users will interact with has the following properties: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/PIPHa26gSWDuxD2TwvZ4", "item.png", "383", "154", "#5098e0", "" ] } ] } [/block] [block:callout] { "type": "info", "title": "Authenticate Users", "body": "Keep in mind that, before creating connection or sending and receiving events you need to authenticate the users. That process is described in the [Authenticate Users](authenticate-users) section." } [/block] ## Create events Time to send our two example events to the Tapglue API. We will send the following two events: * Marc comments on the news article * Neal likes the news article Since Lisa follows both Marc and Neal she will receive these two events in her news feed later. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/12FcyUaqSFmfU2OhRWWU", "activity.png", "215", "181", "#b9a586", "" ] } ] } [/block] **Marc comments on the News Article** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/events \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"verb\":\"comment\",\n \"object\":{\n \"id\":\"article_1\",\n \"type\":\"article\",\n \"url\":\"myapp://news/article_1\",\n \"display_name\":{\n \"en\":\"Title of article\"\n }\n },\n \"metadata\":{\n \"category\":\"tech\"\n }\n }'", "language": "curl" } ] } [/block] You will get back the event as JSON: [block:code] { "codes": [ { "code": "{\n \"id\":\"1\",\n \"user_id\":\"1\",\n \"verb\":\"comment\",\n \"object\":{\n \"id\":\"article_1\",\n \"type\":\"article\",\n \"display_name\":{\n \"en\":\"Title of article\"\n }\n },\n \"metadata\":{\n \"category\":\"tech\"\n },\n \"enabled\":true,\n \"created_at\":\"2015-03-21T14:28:02.432743827+01:00\",\n \"updated_at\":\"2015-03-21T14:28:02.432743827+01:00\"\n}", "language": "json" } ] } [/block] **Neal likes the News Article** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/events \\\n -X POST \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"verb\":\"like\",\n \"object\":{\n \"id\":\"article_1\",\n \"type\":\"article\",\n \"url\":\"myapp://news/article_1\",\n \"display_name\":{\n \"en\":\"Title of article\"\n }\n },\n \"metadata\":{\n \"category\":\"tech\"\n }\n }'", "language": "curl" } ] } [/block] Simple as that. These events can now be displayed to Lisa who is following Marc and Neal.
Events represent the user interactions in your app that shall be displayed in the news feed. Picking relevant events to display in the news feed is an important conceptual exercise that you should do before implementation. For our example we have defined two interactions that can be done on an objective (in our case a news article) and will serve as the event: Comment and Like Here is a draft of what the screen could look like: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/ISKkEC6RI2tEuAkaDKrO", "Events.png", "290", "515", "#6cb4b0", "" ] } ] } [/block] There are no limitation on which type of interaction fires an event or when this happens. We encourage you to think carefully about when to send the events, though. The object (news article) our sample users will interact with has the following properties: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/PIPHa26gSWDuxD2TwvZ4", "item.png", "383", "154", "#5098e0", "" ] } ] } [/block] [block:callout] { "type": "info", "title": "Authenticate Users", "body": "Keep in mind that, before creating connection or sending and receiving events you need to authenticate the users. That process is described in the [Authenticate Users](authenticate-users) section." } [/block] ## Create events Time to send our two example events to the Tapglue API. We will send the following two events: * Marc comments on the news article * Neal likes the news article Since Lisa follows both Marc and Neal she will receive these two events in her news feed later. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/12FcyUaqSFmfU2OhRWWU", "activity.png", "215", "181", "#b9a586", "" ] } ] } [/block] **Marc comments on the News Article** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/events \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"verb\":\"comment\",\n \"object\":{\n \"id\":\"article_1\",\n \"type\":\"article\",\n \"url\":\"myapp://news/article_1\",\n \"display_name\":{\n \"en\":\"Title of article\"\n }\n },\n \"metadata\":{\n \"category\":\"tech\"\n }\n }'", "language": "curl" } ] } [/block] You will get back the event as JSON: [block:code] { "codes": [ { "code": "{\n \"id\":\"1\",\n \"user_id\":\"1\",\n \"verb\":\"comment\",\n \"object\":{\n \"id\":\"article_1\",\n \"type\":\"article\",\n \"display_name\":{\n \"en\":\"Title of article\"\n }\n },\n \"metadata\":{\n \"category\":\"tech\"\n },\n \"enabled\":true,\n \"created_at\":\"2015-03-21T14:28:02.432743827+01:00\",\n \"updated_at\":\"2015-03-21T14:28:02.432743827+01:00\"\n}", "language": "json" } ] } [/block] **Neal likes the News Article** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/events \\\n -X POST \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json' \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"verb\":\"like\",\n \"object\":{\n \"id\":\"article_1\",\n \"type\":\"article\",\n \"url\":\"myapp://news/article_1\",\n \"display_name\":{\n \"en\":\"Title of article\"\n }\n },\n \"metadata\":{\n \"category\":\"tech\"\n }\n }'", "language": "curl" } ] } [/block] Simple as that. These events can now be displayed to Lisa who is following Marc and Neal.
{"__v":19,"_id":"553f83a06a7d010d0057c81b","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"It's time to bring our small social graph to life and make it visual by displaying the news feed. In our example we will display the news feed of Lisa which contains the events performed by Marc and Neal. \n\n**Receive News Feed**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/0.2/user/feed \\\\\\n    -u APP_TOKEN:SESSION_TOKEN \\\\\\n    -H 'Accept: application/json'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nThis is what the result will look like:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n    {\\n        \\\"id\\\":\\\"2\\\",\\n        \\\"user_id\\\":\\\"2\\\",\\n        \\\"verb\\\":\\\"like\\\",\\n        \\\"object\\\":{\\n            \\\"id\\\":\\\"article_1\\\",\\n            \\\"type\\\":\\\"article\\\",\\n            \\\"display_name\\\":{\\n                \\\"en\\\":\\\"Title of article\\\"\\n            }\\n        },\\n        \\\"metadata\\\":{\\n            \\\"category\\\":\\\"tech\\\"\\n        },\\n        \\\"enabled\\\":true,\\n        \\\"created_at\\\":\\\"2015-03-21T15:56:17.417538081+01:00\\\",\\n        \\\"updated_at\\\":\\\"2015-03-21T15:56:17.417538081+01:00\\\"\\n    },\\n    {\\n        \\\"id\\\":\\\"1\\\",\\n        \\\"user_id\\\":\\\"1\\\",\\n        \\\"verb\\\":\\\"comment\\\",\\n        \\\"object\\\":{\\n            \\\"id\\\":\\\"article_1\\\",\\n            \\\"type\\\":\\\"article\\\",\\n            \\\"display_name\\\":{\\n                \\\"en\\\":\\\"Title of article\\\"\\n            }\\n        },\\n        \\\"metadata\\\":{\\n            \\\"category\\\":\\\"tech\\\"\\n        },\\n        \\\"enabled\\\":true,\\n        \\\"created_at\\\":\\\"2015-03-21T15:56:15.890173212+01:00\\\",\\n        \\\"updated_at\\\":\\\"2015-03-21T15:56:15.890173212+01:00\\\"\\n    }\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThat's it! With these few simple steps we have created a neat news feed that will make Lisa use the application more often.\n\nNow parse that data into a native object for the programming language you are developing in and display it in a nice design that delights your users. \n\nSticking to our very simple example the news feed might look like this:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/bungO1H8QExWC1BmWA2R\",\n        \"feed.png\",\n        \"290\",\n        \"515\",\n        \"#88b832\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nWe're happy to see your awesome use cases. **[Get in touch](mailto:contact@tapglue.com)** if you have any feedback, input or questions!","category":"553f925123c53c0d00cccd3f","createdAt":"2015-04-23T10:01:32.178Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":5,"project":"5538be9dfd56310d00b173d0","slug":"display-news-feed","sync_unique":"","title":"Display News Feed","type":"basic","updates":["554893f8d2c8410d006c21d9"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Display News Feed


It's time to bring our small social graph to life and make it visual by displaying the news feed. In our example we will display the news feed of Lisa which contains the events performed by Marc and Neal. **Receive News Feed** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/feed \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json'", "language": "curl" } ] } [/block] This is what the result will look like: [block:code] { "codes": [ { "code": "[\n {\n \"id\":\"2\",\n \"user_id\":\"2\",\n \"verb\":\"like\",\n \"object\":{\n \"id\":\"article_1\",\n \"type\":\"article\",\n \"display_name\":{\n \"en\":\"Title of article\"\n }\n },\n \"metadata\":{\n \"category\":\"tech\"\n },\n \"enabled\":true,\n \"created_at\":\"2015-03-21T15:56:17.417538081+01:00\",\n \"updated_at\":\"2015-03-21T15:56:17.417538081+01:00\"\n },\n {\n \"id\":\"1\",\n \"user_id\":\"1\",\n \"verb\":\"comment\",\n \"object\":{\n \"id\":\"article_1\",\n \"type\":\"article\",\n \"display_name\":{\n \"en\":\"Title of article\"\n }\n },\n \"metadata\":{\n \"category\":\"tech\"\n },\n \"enabled\":true,\n \"created_at\":\"2015-03-21T15:56:15.890173212+01:00\",\n \"updated_at\":\"2015-03-21T15:56:15.890173212+01:00\"\n }\n]", "language": "json" } ] } [/block] That's it! With these few simple steps we have created a neat news feed that will make Lisa use the application more often. Now parse that data into a native object for the programming language you are developing in and display it in a nice design that delights your users. Sticking to our very simple example the news feed might look like this: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/bungO1H8QExWC1BmWA2R", "feed.png", "290", "515", "#88b832", "" ] } ] } [/block] We're happy to see your awesome use cases. **[Get in touch](mailto:contact@tapglue.com)** if you have any feedback, input or questions!
It's time to bring our small social graph to life and make it visual by displaying the news feed. In our example we will display the news feed of Lisa which contains the events performed by Marc and Neal. **Receive News Feed** [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/0.2/user/feed \\\n -u APP_TOKEN:SESSION_TOKEN \\\n -H 'Accept: application/json'", "language": "curl" } ] } [/block] This is what the result will look like: [block:code] { "codes": [ { "code": "[\n {\n \"id\":\"2\",\n \"user_id\":\"2\",\n \"verb\":\"like\",\n \"object\":{\n \"id\":\"article_1\",\n \"type\":\"article\",\n \"display_name\":{\n \"en\":\"Title of article\"\n }\n },\n \"metadata\":{\n \"category\":\"tech\"\n },\n \"enabled\":true,\n \"created_at\":\"2015-03-21T15:56:17.417538081+01:00\",\n \"updated_at\":\"2015-03-21T15:56:17.417538081+01:00\"\n },\n {\n \"id\":\"1\",\n \"user_id\":\"1\",\n \"verb\":\"comment\",\n \"object\":{\n \"id\":\"article_1\",\n \"type\":\"article\",\n \"display_name\":{\n \"en\":\"Title of article\"\n }\n },\n \"metadata\":{\n \"category\":\"tech\"\n },\n \"enabled\":true,\n \"created_at\":\"2015-03-21T15:56:15.890173212+01:00\",\n \"updated_at\":\"2015-03-21T15:56:15.890173212+01:00\"\n }\n]", "language": "json" } ] } [/block] That's it! With these few simple steps we have created a neat news feed that will make Lisa use the application more often. Now parse that data into a native object for the programming language you are developing in and display it in a nice design that delights your users. Sticking to our very simple example the news feed might look like this: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/bungO1H8QExWC1BmWA2R", "feed.png", "290", "515", "#88b832", "" ] } ] } [/block] We're happy to see your awesome use cases. **[Get in touch](mailto:contact@tapglue.com)** if you have any feedback, input or questions!
{"__v":11,"_id":"553f83a06a7d010d0057c81e","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"## Introduction\n\nThe Tapglue API is created with a REST architecture in mind. It is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP verbs, which can be understood by off-the-shelf HTTP clients.\n\nYou can also directly access the [API Reference](doc:users) for the detailed low-level documentation.\n\n## API Compatibility\n\nThe API will evolve over time. Future versions of this API may add new endpoints or parameters. In order to keep older clients working, the behavior and return value of APIs with given parameter values will not change from the currently documented behavior and return values.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Security Notice\",\n  \"body\": \"If we become aware that a certain version of the API contains something that's critical for the security of our users we reserve the right to give you a short notice so you can upgrade to version that will fix the issue. We will work with you to overcome any possible issues in regards to upgrading to a fixed version of the API.\"\n}\n[/block]\n## SSL Only\n\nWe require that all requests are done over SSL, thus all access is over HTTPS, and accessed from the **api.tapglue.com** domain. Unencrypted HTTP is not supported.\n\n## JSON Only\n\nAll data is sent and received as JSON, including errors.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Third party errors\",\n  \"body\": \"While we'll do our best not to return 4xx and 5xx errors, we cannot control external factors that stand between our servers and your clients. As such, be prepared to receive non-JSON from third parties (such as a CDN provider) in case something goes wrong.\"\n}\n[/block]\n\n\n## UTF-8 Encoding\n\nEvery string passed to and from the Tapglue API needs to be UTF-8 encoded. For maximum compatibility, normalize to Unicode Normalization Form C (NFC) before UTF-8 encoding.\n\n## Date Format\n\nAll dates and timestamps are returned in RFC 3339 format:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Format\",\n    \"h-1\": \"Example\",\n    \"0-0\": \"YYYY-MM-DDTHH:MM:SSZ\",\n    \"0-1\": \"2015-01-28T23:25:15Z\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n## Blank Fields\n\nBlank fields are being omitted instead of included as null.\n\n## HTTP Verbs\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Method\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Retrieve a resource\",\n    \"1-1\": \"Create a resource\",\n    \"2-1\": \"Update a resource\",\n    \"3-1\": \"Delete a resource\",\n    \"0-0\": \"`GET`\",\n    \"1-0\": \"`POST`\",\n    \"2-0\": \"`PUT`\",\n    \"3-0\": \"`DELETE`\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n## User Agent Required\n\nAll API requests MUST include a valid User-Agent header. Requests with no User-Agent header will be rejected. A good practice is to send the application name and version for the User-Agent header value, this allows us to contact you if there are problems.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"User-Agent: Awesome-Tapglue-App 1.0\",\n      \"language\": \"curl\",\n      \"name\": \"User-Agent\"\n    }\n  ]\n}\n[/block]\n## Cross Origin Resource Sharing\n\nWe support cross-origin resource sharing (CORS) to allow you to interact securely with our API from a client-side web application (though you should remember that you should not expose your secret API key in any public applications client-side code).\n\n## Base URL\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://api.tapglue.com\",\n      \"language\": \"text\",\n      \"name\": \"Base URL\"\n    }\n  ]\n}\n[/block]\n## API Changelog\n\nAPI Changelog monitors the docs of our API and sends you notifications when they change. Follow our API and you'll be always up-to-date.\n[block:embed]\n{\n  \"html\": false,\n  \"url\": \"https://www.apichangelog.com/static/widget/follow/tapglue.html\",\n  \"title\": \"Tapglue API Changelog API Changelog\",\n  \"favicon\": \"https://www.apichangelog.com/static/img/rs-eye-2x.png\",\n  \"iframe\": true\n}\n[/block]","category":"553f839f6a7d010d0057c809","createdAt":"2015-04-23T09:56:17.312Z","excerpt":"This page will help you get an Overview on our API and understand the concepts behind it!","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"5538be9dfd56310d00b173d0","slug":"overview","sync_unique":"","title":"Overview","type":"basic","updates":["554897dbb2581a0d0091406e"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Overview

This page will help you get an Overview on our API and understand the concepts behind it!

## Introduction The Tapglue API is created with a REST architecture in mind. It is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP verbs, which can be understood by off-the-shelf HTTP clients. You can also directly access the [API Reference](doc:users) for the detailed low-level documentation. ## API Compatibility The API will evolve over time. Future versions of this API may add new endpoints or parameters. In order to keep older clients working, the behavior and return value of APIs with given parameter values will not change from the currently documented behavior and return values. [block:callout] { "type": "danger", "title": "Security Notice", "body": "If we become aware that a certain version of the API contains something that's critical for the security of our users we reserve the right to give you a short notice so you can upgrade to version that will fix the issue. We will work with you to overcome any possible issues in regards to upgrading to a fixed version of the API." } [/block] ## SSL Only We require that all requests are done over SSL, thus all access is over HTTPS, and accessed from the **api.tapglue.com** domain. Unencrypted HTTP is not supported. ## JSON Only All data is sent and received as JSON, including errors. [block:callout] { "type": "info", "title": "Third party errors", "body": "While we'll do our best not to return 4xx and 5xx errors, we cannot control external factors that stand between our servers and your clients. As such, be prepared to receive non-JSON from third parties (such as a CDN provider) in case something goes wrong." } [/block] ## UTF-8 Encoding Every string passed to and from the Tapglue API needs to be UTF-8 encoded. For maximum compatibility, normalize to Unicode Normalization Form C (NFC) before UTF-8 encoding. ## Date Format All dates and timestamps are returned in RFC 3339 format: [block:parameters] { "data": { "h-0": "Format", "h-1": "Example", "0-0": "YYYY-MM-DDTHH:MM:SSZ", "0-1": "2015-01-28T23:25:15Z" }, "cols": 2, "rows": 1 } [/block] ## Blank Fields Blank fields are being omitted instead of included as null. ## HTTP Verbs [block:parameters] { "data": { "h-0": "Method", "h-1": "Description", "0-1": "Retrieve a resource", "1-1": "Create a resource", "2-1": "Update a resource", "3-1": "Delete a resource", "0-0": "`GET`", "1-0": "`POST`", "2-0": "`PUT`", "3-0": "`DELETE`" }, "cols": 2, "rows": 4 } [/block] ## User Agent Required All API requests MUST include a valid User-Agent header. Requests with no User-Agent header will be rejected. A good practice is to send the application name and version for the User-Agent header value, this allows us to contact you if there are problems. [block:code] { "codes": [ { "code": "User-Agent: Awesome-Tapglue-App 1.0", "language": "curl", "name": "User-Agent" } ] } [/block] ## Cross Origin Resource Sharing We support cross-origin resource sharing (CORS) to allow you to interact securely with our API from a client-side web application (though you should remember that you should not expose your secret API key in any public applications client-side code). ## Base URL [block:code] { "codes": [ { "code": "https://api.tapglue.com", "language": "text", "name": "Base URL" } ] } [/block] ## API Changelog API Changelog monitors the docs of our API and sends you notifications when they change. Follow our API and you'll be always up-to-date. [block:embed] { "html": false, "url": "https://www.apichangelog.com/static/widget/follow/tapglue.html", "title": "Tapglue API Changelog API Changelog", "favicon": "https://www.apichangelog.com/static/img/rs-eye-2x.png", "iframe": true } [/block]
## Introduction The Tapglue API is created with a REST architecture in mind. It is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP verbs, which can be understood by off-the-shelf HTTP clients. You can also directly access the [API Reference](doc:users) for the detailed low-level documentation. ## API Compatibility The API will evolve over time. Future versions of this API may add new endpoints or parameters. In order to keep older clients working, the behavior and return value of APIs with given parameter values will not change from the currently documented behavior and return values. [block:callout] { "type": "danger", "title": "Security Notice", "body": "If we become aware that a certain version of the API contains something that's critical for the security of our users we reserve the right to give you a short notice so you can upgrade to version that will fix the issue. We will work with you to overcome any possible issues in regards to upgrading to a fixed version of the API." } [/block] ## SSL Only We require that all requests are done over SSL, thus all access is over HTTPS, and accessed from the **api.tapglue.com** domain. Unencrypted HTTP is not supported. ## JSON Only All data is sent and received as JSON, including errors. [block:callout] { "type": "info", "title": "Third party errors", "body": "While we'll do our best not to return 4xx and 5xx errors, we cannot control external factors that stand between our servers and your clients. As such, be prepared to receive non-JSON from third parties (such as a CDN provider) in case something goes wrong." } [/block] ## UTF-8 Encoding Every string passed to and from the Tapglue API needs to be UTF-8 encoded. For maximum compatibility, normalize to Unicode Normalization Form C (NFC) before UTF-8 encoding. ## Date Format All dates and timestamps are returned in RFC 3339 format: [block:parameters] { "data": { "h-0": "Format", "h-1": "Example", "0-0": "YYYY-MM-DDTHH:MM:SSZ", "0-1": "2015-01-28T23:25:15Z" }, "cols": 2, "rows": 1 } [/block] ## Blank Fields Blank fields are being omitted instead of included as null. ## HTTP Verbs [block:parameters] { "data": { "h-0": "Method", "h-1": "Description", "0-1": "Retrieve a resource", "1-1": "Create a resource", "2-1": "Update a resource", "3-1": "Delete a resource", "0-0": "`GET`", "1-0": "`POST`", "2-0": "`PUT`", "3-0": "`DELETE`" }, "cols": 2, "rows": 4 } [/block] ## User Agent Required All API requests MUST include a valid User-Agent header. Requests with no User-Agent header will be rejected. A good practice is to send the application name and version for the User-Agent header value, this allows us to contact you if there are problems. [block:code] { "codes": [ { "code": "User-Agent: Awesome-Tapglue-App 1.0", "language": "curl", "name": "User-Agent" } ] } [/block] ## Cross Origin Resource Sharing We support cross-origin resource sharing (CORS) to allow you to interact securely with our API from a client-side web application (though you should remember that you should not expose your secret API key in any public applications client-side code). ## Base URL [block:code] { "codes": [ { "code": "https://api.tapglue.com", "language": "text", "name": "Base URL" } ] } [/block] ## API Changelog API Changelog monitors the docs of our API and sends you notifications when they change. Follow our API and you'll be always up-to-date. [block:embed] { "html": false, "url": "https://www.apichangelog.com/static/widget/follow/tapglue.html", "title": "Tapglue API Changelog API Changelog", "favicon": "https://www.apichangelog.com/static/img/rs-eye-2x.png", "iframe": true } [/block]
{"__v":8,"_id":"553f83a06a7d010d0057c81f","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Authentication to the API occurs via HTTP Basic Auth. Provide  your app token as the basic auth username and the session token as password.\n\nAll API requests must be made over HTTPS. Calls made over plain HTTP will fail. You must authenticate for all requests.\n\n## App token\n\nYou authenticate to the Tapglue API by providing one of your app tokens in the request header. First you have to create an application in the dashboard to get an application key. You can manage your app tokens of your account in the dashboards applications section. Your token carry many privileges, so be sure to keep them secret!\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Secure Tokens\",\n  \"body\": \"It is very important that you keep your tokens secret. Treat them in the most secure way.\"\n}\n[/block]\n## Session token\n\nAll requests, except creating users, require a session token. If you are using our user management we will provide the token to you after you login (`users/login`) endpoint.\n\nIf you have your own user management your backend will have to create the session token. Stay tuned, we'll show you how to do it here soon!\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Tapglue User Management vs Your Backend\",\n  \"body\": \"We handle everything you need for your user management. If you still want to use your own or already have one, we support you with everything you need to get started and integrate with our API.\\n\\nIf you decide to use your own user management get in touch with us and we show you how to create the `SESSION_TOKEN` from your backend.\"\n}\n[/block]\n## Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl  https://api.tapglue.com \\\\\\n\\t-u APP_TOKEN:SESSION_TOKEN\",\n      \"language\": \"curl\",\n      \"name\": \"cURL\"\n    }\n  ]\n}\n[/block]","category":"553f839f6a7d010d0057c809","createdAt":"2015-04-23T09:58:10.298Z","excerpt":"This page will help you show you the details to authenticate with our API. Go ahead and create a secure connection with a single call!","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"5538be9dfd56310d00b173d0","slug":"authentication","sync_unique":"","title":"Authentication","type":"basic","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Authentication

This page will help you show you the details to authenticate with our API. Go ahead and create a secure connection with a single call!

Authentication to the API occurs via HTTP Basic Auth. Provide your app token as the basic auth username and the session token as password. All API requests must be made over HTTPS. Calls made over plain HTTP will fail. You must authenticate for all requests. ## App token You authenticate to the Tapglue API by providing one of your app tokens in the request header. First you have to create an application in the dashboard to get an application key. You can manage your app tokens of your account in the dashboards applications section. Your token carry many privileges, so be sure to keep them secret! [block:callout] { "type": "danger", "title": "Secure Tokens", "body": "It is very important that you keep your tokens secret. Treat them in the most secure way." } [/block] ## Session token All requests, except creating users, require a session token. If you are using our user management we will provide the token to you after you login (`users/login`) endpoint. If you have your own user management your backend will have to create the session token. Stay tuned, we'll show you how to do it here soon! [block:callout] { "type": "info", "title": "Tapglue User Management vs Your Backend", "body": "We handle everything you need for your user management. If you still want to use your own or already have one, we support you with everything you need to get started and integrate with our API.\n\nIf you decide to use your own user management get in touch with us and we show you how to create the `SESSION_TOKEN` from your backend." } [/block] ## Example [block:code] { "codes": [ { "code": "curl https://api.tapglue.com \\\n\t-u APP_TOKEN:SESSION_TOKEN", "language": "curl", "name": "cURL" } ] } [/block]
Authentication to the API occurs via HTTP Basic Auth. Provide your app token as the basic auth username and the session token as password. All API requests must be made over HTTPS. Calls made over plain HTTP will fail. You must authenticate for all requests. ## App token You authenticate to the Tapglue API by providing one of your app tokens in the request header. First you have to create an application in the dashboard to get an application key. You can manage your app tokens of your account in the dashboards applications section. Your token carry many privileges, so be sure to keep them secret! [block:callout] { "type": "danger", "title": "Secure Tokens", "body": "It is very important that you keep your tokens secret. Treat them in the most secure way." } [/block] ## Session token All requests, except creating users, require a session token. If you are using our user management we will provide the token to you after you login (`users/login`) endpoint. If you have your own user management your backend will have to create the session token. Stay tuned, we'll show you how to do it here soon! [block:callout] { "type": "info", "title": "Tapglue User Management vs Your Backend", "body": "We handle everything you need for your user management. If you still want to use your own or already have one, we support you with everything you need to get started and integrate with our API.\n\nIf you decide to use your own user management get in touch with us and we show you how to create the `SESSION_TOKEN` from your backend." } [/block] ## Example [block:code] { "codes": [ { "code": "curl https://api.tapglue.com \\\n\t-u APP_TOKEN:SESSION_TOKEN", "language": "curl", "name": "cURL" } ] } [/block]
{"__v":8,"_id":"553f83a06a7d010d0057c820","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"## Current Version\n\nThe current version of the API is `0.2` and comes right after the base URL.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://api.tapglue.com/0.2/\",\n      \"language\": \"text\",\n      \"name\": \"Version\"\n    }\n  ]\n}\n[/block]\nWhen we make backwards-incompatible changes to the API, we release new numbered version.\n\nTo retrieve information about the status about all versions our API supports you can `GET` the versions endpoint.\n\nAs shown in the example we'll return information about all versions of our API.\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Versions Endpoint\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.tapglue.com/versions\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n    {\\n        \\\"version\\\":\\\"0.1\\\",\\n        \\\"status\\\":\\\"disabled\\\"\\n    },\\n    {\\n        \\\"version\\\":\\\"0.2\\\",\\n        \\\"status\\\":\\\"current\\\"\\n    }\\n]\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","category":"553f839f6a7d010d0057c809","createdAt":"2015-04-23T09:58:39.300Z","excerpt":"This page will describe everything you need to know regarding our API versioning.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"project":"5538be9dfd56310d00b173d0","slug":"versioning","sync_unique":"","title":"Versioning","type":"basic","updates":["55436dfdb7f4540d00fcef52"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Versioning

This page will describe everything you need to know regarding our API versioning.

## Current Version The current version of the API is `0.2` and comes right after the base URL. [block:code] { "codes": [ { "code": "https://api.tapglue.com/0.2/", "language": "text", "name": "Version" } ] } [/block] When we make backwards-incompatible changes to the API, we release new numbered version. To retrieve information about the status about all versions our API supports you can `GET` the versions endpoint. As shown in the example we'll return information about all versions of our API. [block:api-header] { "type": "get", "title": "Versions Endpoint", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/versions", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"version\":\"0.1\",\n \"status\":\"disabled\"\n },\n {\n \"version\":\"0.2\",\n \"status\":\"current\"\n }\n]", "language": "json" } ], "sidebar": true } [/block]
## Current Version The current version of the API is `0.2` and comes right after the base URL. [block:code] { "codes": [ { "code": "https://api.tapglue.com/0.2/", "language": "text", "name": "Version" } ] } [/block] When we make backwards-incompatible changes to the API, we release new numbered version. To retrieve information about the status about all versions our API supports you can `GET` the versions endpoint. As shown in the example we'll return information about all versions of our API. [block:api-header] { "type": "get", "title": "Versions Endpoint", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "curl https://api.tapglue.com/versions", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"version\":\"0.1\",\n \"status\":\"disabled\"\n },\n {\n \"version\":\"0.2\",\n \"status\":\"current\"\n }\n]", "language": "json" } ], "sidebar": true } [/block]
{"__v":2,"_id":"553f83a06a7d010d0057c821","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"The response from our API will have an HTTP status code that will help you determine the cause of the error. Our API uses the appropriate HTTP status code to indicate the type of problem encountered.\n\n## Response Status Codes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Code\",\n    \"h-1\": \"Category\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`1XX`\",\n    \"1-0\": \"`2XX`\",\n    \"2-0\": \"`3XX`\",\n    \"3-0\": \"`4XX`\",\n    \"4-0\": \"`5XX`\",\n    \"0-1\": \"Informational\",\n    \"1-1\": \"Success\",\n    \"2-1\": \"Redirection\",\n    \"3-1\": \"Client error\",\n    \"4-1\": \"Server error\",\n    \"0-2\": \"Communicates transfer protocol-level information.\",\n    \"1-2\": \"Indicates that the client request was accepted successfully.\",\n    \"2-2\": \"Indicates that the client must take some additional action in order to complete their request.\",\n    \"3-2\": \"This category of error status codes indicates and error coming from the clients side.\",\n    \"4-2\": \"The server takes responsibility for these error status codes.\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]","category":"553f839f6a7d010d0057c809","createdAt":"2015-04-23T09:58:52.939Z","excerpt":"You want to talk to our API? Let the status codes do the talking for you!","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"project":"5538be9dfd56310d00b173d0","slug":"status-codes","sync_unique":"","title":"Status Codes","type":"basic","updates":["554898cdd2c8410d006c21e3"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Status Codes

You want to talk to our API? Let the status codes do the talking for you!

The response from our API will have an HTTP status code that will help you determine the cause of the error. Our API uses the appropriate HTTP status code to indicate the type of problem encountered. ## Response Status Codes [block:parameters] { "data": { "h-0": "Code", "h-1": "Category", "h-2": "Description", "0-0": "`1XX`", "1-0": "`2XX`", "2-0": "`3XX`", "3-0": "`4XX`", "4-0": "`5XX`", "0-1": "Informational", "1-1": "Success", "2-1": "Redirection", "3-1": "Client error", "4-1": "Server error", "0-2": "Communicates transfer protocol-level information.", "1-2": "Indicates that the client request was accepted successfully.", "2-2": "Indicates that the client must take some additional action in order to complete their request.", "3-2": "This category of error status codes indicates and error coming from the clients side.", "4-2": "The server takes responsibility for these error status codes." }, "cols": 3, "rows": 5 } [/block]
The response from our API will have an HTTP status code that will help you determine the cause of the error. Our API uses the appropriate HTTP status code to indicate the type of problem encountered. ## Response Status Codes [block:parameters] { "data": { "h-0": "Code", "h-1": "Category", "h-2": "Description", "0-0": "`1XX`", "1-0": "`2XX`", "2-0": "`3XX`", "3-0": "`4XX`", "4-0": "`5XX`", "0-1": "Informational", "1-1": "Success", "2-1": "Redirection", "3-1": "Client error", "4-1": "Server error", "0-2": "Communicates transfer protocol-level information.", "1-2": "Indicates that the client request was accepted successfully.", "2-2": "Indicates that the client must take some additional action in order to complete their request.", "3-2": "This category of error status codes indicates and error coming from the clients side.", "4-2": "The server takes responsibility for these error status codes." }, "cols": 3, "rows": 5 } [/block]
{"__v":1,"_id":"553f83a06a7d010d0057c822","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"When an error occurs, our API will return an appropriate HTTP status code and an error message description.\n\nIn general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, etc.), and codes in the 5xx range indicate an error with our servers.\n\n## Client Errors\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`401`\",\n    \"h-0\": \"Code\",\n    \"h-1\": \"Category\",\n    \"h-2\": \"Description\",\n    \"0-1\": \"Unauthorized\",\n    \"0-2\": \"The supplied credentials, if any, are not sufficient to access the resource.\",\n    \"null-0\": \"`\",\n    \"1-0\": \"`403`\",\n    \"1-1\": \"Forbidden\",\n    \"1-2\": \"You don't have access to whatever it is you're asking for.\",\n    \"2-0\": \"`404`\",\n    \"2-1\": \"Not Found\",\n    \"2-2\": \"The requested resource was not found on the server.\",\n    \"3-0\": \"`405`\",\n    \"3-1\": \"Method Not Allowed\",\n    \"3-2\": \"The method (i.e. POST is not allowed for the resource.\",\n    \"4-0\": \"`406`\",\n    \"4-1\": \"Not Accessible\",\n    \"4-2\": \"We found what you're looking for, but it can't be represented in the format you requested.\",\n    \"5-0\": \"`409`\",\n    \"5-1\": \"Conflict\",\n    \"5-2\": \"You cannot create or update a resource because another resource already exists or conflicts with one you are submitting.\",\n    \"6-0\": \"`415`\",\n    \"6-1\": \"Unsupported Media Type\",\n    \"6-2\": \"You did not specify the request Content-Type header to have a value of `application/json`.\",\n    \"7-0\": \"`422`\",\n    \"7-1\": \"Unprocessable Entity\",\n    \"7-2\": \"The request looks alright, but one or more of the parameters looks a little screwy. It is possible that you sent data in the wrong format (e.g. an array where we expected a string).\",\n    \"8-0\": \"`429`\",\n    \"8-1\": \"Too Many Requests\",\n    \"8-2\": \"Your application is sending too many simultaneous requests. It might be a good idea to check your [Rate Limits](doc:rate-limits)\"\n  },\n  \"cols\": 3,\n  \"rows\": 9\n}\n[/block]\n## Server Errors\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Code\",\n    \"h-1\": \"Category\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`500`\",\n    \"0-1\": \"Server Error\",\n    \"0-2\": \"We couldn't return the representation due to an internal server error.\",\n    \"1-0\": \"`503`\",\n    \"1-1\": \"Service Unavailable\",\n    \"1-2\": \"We are temporarily unable to return the representation. Please wait for a bit and try again.\",\n    \"2-0\": \"`504`\",\n    \"2-1\": \"Gateway Timeout\",\n    \"2-2\": \"This means the request is taking too long. It doesn't necessarily mean that we didn't receive your request and aren't chugging away on the changes you made though, so you may want to check before retrying.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]","category":"553f839f6a7d010d0057c809","createdAt":"2015-04-23T09:59:52.768Z","excerpt":"Clear communication is key, we don't let you down if something goes wrong.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":4,"project":"5538be9dfd56310d00b173d0","slug":"error-handling","sync_unique":"","title":"Error Handling","type":"basic","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Error Handling

Clear communication is key, we don't let you down if something goes wrong.

When an error occurs, our API will return an appropriate HTTP status code and an error message description. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, etc.), and codes in the 5xx range indicate an error with our servers. ## Client Errors [block:parameters] { "data": { "0-0": "`401`", "h-0": "Code", "h-1": "Category", "h-2": "Description", "0-1": "Unauthorized", "0-2": "The supplied credentials, if any, are not sufficient to access the resource.", "null-0": "`", "1-0": "`403`", "1-1": "Forbidden", "1-2": "You don't have access to whatever it is you're asking for.", "2-0": "`404`", "2-1": "Not Found", "2-2": "The requested resource was not found on the server.", "3-0": "`405`", "3-1": "Method Not Allowed", "3-2": "The method (i.e. POST is not allowed for the resource.", "4-0": "`406`", "4-1": "Not Accessible", "4-2": "We found what you're looking for, but it can't be represented in the format you requested.", "5-0": "`409`", "5-1": "Conflict", "5-2": "You cannot create or update a resource because another resource already exists or conflicts with one you are submitting.", "6-0": "`415`", "6-1": "Unsupported Media Type", "6-2": "You did not specify the request Content-Type header to have a value of `application/json`.", "7-0": "`422`", "7-1": "Unprocessable Entity", "7-2": "The request looks alright, but one or more of the parameters looks a little screwy. It is possible that you sent data in the wrong format (e.g. an array where we expected a string).", "8-0": "`429`", "8-1": "Too Many Requests", "8-2": "Your application is sending too many simultaneous requests. It might be a good idea to check your [Rate Limits](doc:rate-limits)" }, "cols": 3, "rows": 9 } [/block] ## Server Errors [block:parameters] { "data": { "h-0": "Code", "h-1": "Category", "h-2": "Description", "0-0": "`500`", "0-1": "Server Error", "0-2": "We couldn't return the representation due to an internal server error.", "1-0": "`503`", "1-1": "Service Unavailable", "1-2": "We are temporarily unable to return the representation. Please wait for a bit and try again.", "2-0": "`504`", "2-1": "Gateway Timeout", "2-2": "This means the request is taking too long. It doesn't necessarily mean that we didn't receive your request and aren't chugging away on the changes you made though, so you may want to check before retrying." }, "cols": 3, "rows": 3 } [/block]
When an error occurs, our API will return an appropriate HTTP status code and an error message description. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, etc.), and codes in the 5xx range indicate an error with our servers. ## Client Errors [block:parameters] { "data": { "0-0": "`401`", "h-0": "Code", "h-1": "Category", "h-2": "Description", "0-1": "Unauthorized", "0-2": "The supplied credentials, if any, are not sufficient to access the resource.", "null-0": "`", "1-0": "`403`", "1-1": "Forbidden", "1-2": "You don't have access to whatever it is you're asking for.", "2-0": "`404`", "2-1": "Not Found", "2-2": "The requested resource was not found on the server.", "3-0": "`405`", "3-1": "Method Not Allowed", "3-2": "The method (i.e. POST is not allowed for the resource.", "4-0": "`406`", "4-1": "Not Accessible", "4-2": "We found what you're looking for, but it can't be represented in the format you requested.", "5-0": "`409`", "5-1": "Conflict", "5-2": "You cannot create or update a resource because another resource already exists or conflicts with one you are submitting.", "6-0": "`415`", "6-1": "Unsupported Media Type", "6-2": "You did not specify the request Content-Type header to have a value of `application/json`.", "7-0": "`422`", "7-1": "Unprocessable Entity", "7-2": "The request looks alright, but one or more of the parameters looks a little screwy. It is possible that you sent data in the wrong format (e.g. an array where we expected a string).", "8-0": "`429`", "8-1": "Too Many Requests", "8-2": "Your application is sending too many simultaneous requests. It might be a good idea to check your [Rate Limits](doc:rate-limits)" }, "cols": 3, "rows": 9 } [/block] ## Server Errors [block:parameters] { "data": { "h-0": "Code", "h-1": "Category", "h-2": "Description", "0-0": "`500`", "0-1": "Server Error", "0-2": "We couldn't return the representation due to an internal server error.", "1-0": "`503`", "1-1": "Service Unavailable", "1-2": "We are temporarily unable to return the representation. Please wait for a bit and try again.", "2-0": "`504`", "2-1": "Gateway Timeout", "2-2": "This means the request is taking too long. It doesn't necessarily mean that we didn't receive your request and aren't chugging away on the changes you made though, so you may want to check before retrying." }, "cols": 3, "rows": 3 } [/block]
{"__v":6,"_id":"553f83a06a7d010d0057c823","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Our #1 job here at Tapglue is to maintain the reliability and stability of our API for all our users. As you might expect, we’ve put a number of protections in place to safeguard the service.\n\nEvery integration is different and many of our limits are tuneable by project. The limits documented here are simply the “out of the box? service levels you should expect. Contact us if you’d like to discuss custom limits for your project!\n\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Rate Limits\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Method\",\n    \"h-1\": \"Category\",\n    \"h-2\": \"Limit\",\n    \"0-0\": \"`POST` `PUT`\",\n    \"0-1\": \"Writing data\",\n    \"0-2\": \"1.000/minute\",\n    \"1-0\": \"`GET`\",\n    \"1-1\": \"Querying data\",\n    \"1-2\": \"1.000/minute\",\n    \"2-0\": \"`DELETE`\",\n    \"2-1\": \"Deleting data\",\n    \"2-2\": \"1.000/minute\"\n  },\n  \"cols\": 3,\n  \"rows\": 3,\n  \"sidebar\": true\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Beta Phase\",\n  \"body\": \"We reserve the right to rate limit other functionality in order to prevent abuse, spam, denial-of-service attacks, or other security issues. While we'll try our best to be transparent with this process, sometimes we might not explicit with the error cause in order to protect you and your users from wrongdoers. Please contact us if you have any questions.\"\n}\n[/block]","category":"553f839f6a7d010d0057c809","createdAt":"2015-04-23T10:00:02.047Z","excerpt":"Firing to many requests? Know your limits ;)","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":5,"project":"5538be9dfd56310d00b173d0","slug":"rate-limits","sync_unique":"","title":"Rate Limits","type":"basic","updates":["55489924b2581a0d00914073"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Rate Limits

Firing to many requests? Know your limits ;)

Our #1 job here at Tapglue is to maintain the reliability and stability of our API for all our users. As you might expect, we’ve put a number of protections in place to safeguard the service. Every integration is different and many of our limits are tuneable by project. The limits documented here are simply the “out of the box? service levels you should expect. Contact us if you’d like to discuss custom limits for your project! [block:api-header] { "type": "basic", "title": "Rate Limits", "sidebar": true } [/block] [block:parameters] { "data": { "h-0": "Method", "h-1": "Category", "h-2": "Limit", "0-0": "`POST` `PUT`", "0-1": "Writing data", "0-2": "1.000/minute", "1-0": "`GET`", "1-1": "Querying data", "1-2": "1.000/minute", "2-0": "`DELETE`", "2-1": "Deleting data", "2-2": "1.000/minute" }, "cols": 3, "rows": 3, "sidebar": true } [/block] [block:callout] { "type": "danger", "title": "Beta Phase", "body": "We reserve the right to rate limit other functionality in order to prevent abuse, spam, denial-of-service attacks, or other security issues. While we'll try our best to be transparent with this process, sometimes we might not explicit with the error cause in order to protect you and your users from wrongdoers. Please contact us if you have any questions." } [/block]
Our #1 job here at Tapglue is to maintain the reliability and stability of our API for all our users. As you might expect, we’ve put a number of protections in place to safeguard the service. Every integration is different and many of our limits are tuneable by project. The limits documented here are simply the “out of the box? service levels you should expect. Contact us if you’d like to discuss custom limits for your project! [block:api-header] { "type": "basic", "title": "Rate Limits", "sidebar": true } [/block] [block:parameters] { "data": { "h-0": "Method", "h-1": "Category", "h-2": "Limit", "0-0": "`POST` `PUT`", "0-1": "Writing data", "0-2": "1.000/minute", "1-0": "`GET`", "1-1": "Querying data", "1-2": "1.000/minute", "2-0": "`DELETE`", "2-1": "Deleting data", "2-2": "1.000/minute" }, "cols": 3, "rows": 3, "sidebar": true } [/block] [block:callout] { "type": "danger", "title": "Beta Phase", "body": "We reserve the right to rate limit other functionality in order to prevent abuse, spam, denial-of-service attacks, or other security issues. While we'll try our best to be transparent with this process, sometimes we might not explicit with the error cause in order to protect you and your users from wrongdoers. Please contact us if you have any questions." } [/block]
{"__v":3,"_id":"553f83a06a7d010d0057c824","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Some resources (Users, Events) support a specified metadata parameter.\n\nYou can use the metadata parameter to attach key-value data in `JSON` format. This is for useful for storing additional structured information about an object. As an example, you could store your users favorite color and corresponding unique identifiers from your system.\n\nThe metadata you specify is returned in API responses.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Metadata Example\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"metadata\\\":{\\n        \\\"favorite color\\\":\\\"green\\\",\\n        \\\"custom_setting\\\":\\\"setting_1\\\",\\n        \\\"value\\\":\\\"10\\\"\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Note\",\n  \"body\": \"You can have up to 10 keys, with key names up to 40 characters long and values up to 500 characters long.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Key Value Types\",\n  \"body\": \"Currently our API support only strings as keys and values for the metadata. If you'd like to store other value types, please let us know.\"\n}\n[/block]","category":"553f839f6a7d010d0057c809","createdAt":"2015-04-23T10:00:12.935Z","excerpt":"Enrich your data to provide a richer experience to your users!","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":6,"project":"5538be9dfd56310d00b173d0","slug":"metadata","sync_unique":"","title":"Metadata","type":"basic","updates":["554899b8afc5ed0d00e14537"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Metadata

Enrich your data to provide a richer experience to your users!

Some resources (Users, Events) support a specified metadata parameter. You can use the metadata parameter to attach key-value data in `JSON` format. This is for useful for storing additional structured information about an object. As an example, you could store your users favorite color and corresponding unique identifiers from your system. The metadata you specify is returned in API responses. [block:api-header] { "type": "basic", "title": "Metadata Example", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"metadata\":{\n \"favorite color\":\"green\",\n \"custom_setting\":\"setting_1\",\n \"value\":\"10\"\n }\n}", "language": "json" } ], "sidebar": true } [/block] [block:callout] { "type": "warning", "title": "Note", "body": "You can have up to 10 keys, with key names up to 40 characters long and values up to 500 characters long." } [/block] [block:callout] { "type": "warning", "title": "Key Value Types", "body": "Currently our API support only strings as keys and values for the metadata. If you'd like to store other value types, please let us know." } [/block]
Some resources (Users, Events) support a specified metadata parameter. You can use the metadata parameter to attach key-value data in `JSON` format. This is for useful for storing additional structured information about an object. As an example, you could store your users favorite color and corresponding unique identifiers from your system. The metadata you specify is returned in API responses. [block:api-header] { "type": "basic", "title": "Metadata Example", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "{\n \"metadata\":{\n \"favorite color\":\"green\",\n \"custom_setting\":\"setting_1\",\n \"value\":\"10\"\n }\n}", "language": "json" } ], "sidebar": true } [/block] [block:callout] { "type": "warning", "title": "Note", "body": "You can have up to 10 keys, with key names up to 40 characters long and values up to 500 characters long." } [/block] [block:callout] { "type": "warning", "title": "Key Value Types", "body": "Currently our API support only strings as keys and values for the metadata. If you'd like to store other value types, please let us know." } [/block]
{"__v":4,"_id":"5559abc2c9cbc70d003db1fb","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"There is currently one type of search that can be performed to find a specific user: a generic Filter-based search that follows a predefined matching logic.\n\n## Filter-Search\n\nA filter search consists of specifying a `q` query parameter and a corresponding search value on a Collection Resource URL:\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example Search\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"**Request**\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -i https://api.tapglue.com/0.2/users/search?q=criteria \\\\\\n-u APP_TOKEN:SESSION_TOKEN \\\\\\n-H 'Accept: application/json'\",\n      \"language\": \"curl\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:textarea]\n{\n  \"text\": \"**Response**\",\n  \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n   {\\n      \\\"id\\\":\\\"8586b3fe-6c7d-5d77-8509-a8b587c8e1ee\\\",\\n      \\\"social_ids\\\":{\\n         \\\"abook\\\":\\\"acc-1-app-1-user-2-abk\\\",\\n         \\\"facebook\\\":\\\"acc-1-app-1-user-2-fb\\\",\\n         \\\"gplus\\\":\\\"acc-1-app-1-user-2-gpl\\\",\\n         \\\"twitter\\\":\\\"acc-1-app-1-user-2-tw\\\"\\n      },\\n      \\\"user_name\\\":\\\"acc-1-app-1-user-2\\\",\\n      \\\"first_name\\\":\\\"acc-1-app-1-user-2-first-name\\\",\\n      \\\"last_name\\\":\\\"acc-1-app-1-user-2-last-name\\\",\\n      \\\"email\\\":\\\"acc-1-app-1-user-2@tapglue-test.com\\\",\\n      \\\"url\\\":\\\"http://tapglue.com/users/1/demouser\\\",\\n      \\\"last_login\\\":\\\"2015-05-18T09:59:34.602+02:00\\\",\\n      \\\"activated\\\":true,\\n      \\\"metadata\\\":{\\n         \\\"customData\\\":\\\"customValue\\\"\\n      },\\n      \\\"image\\\":[\\n         {\\n            \\\"url\\\":\\\"http://images.tapglue.com/1/demouser/profile.jpg\\\"\\n         }\\n      ],\\n      \\\"created_at\\\":\\\"2015-05-18T09:59:34.75+02:00\\\",\\n      \\\"updated_at\\\":\\\"2015-05-18T09:59:34.92+02:00\\\",\\n      \\\"enabled\\\":true\\n   }\\n]\",\n      \"language\": \"json\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n**Matching Logic**\n\nIf the entered criteria, through a case-insensitive comparison, exists within (or is equal to) any viewable attribute on an instance in the collection, that instance is included in the query results.\n\nThis returns all users where:\n\n- The `user_name` equals or contains ‘criteria’ (case insensitive) OR\n- The `first_name` equals or contains ‘criteria’ (case insensitive) OR\n- The `last_name` equals or contains ‘criteria’ (case insensitive) OR\n- The `email` equals or contains ‘criteria’ (case insensitive)\n\netc.","category":"553f839f6a7d010d0057c809","createdAt":"2015-05-18T09:07:14.269Z","excerpt":"Find resources more efficiently by searching for specific keywords","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":999,"project":"5538be9dfd56310d00b173d0","slug":"search","sync_unique":"","title":"Search","type":"basic","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

Search

Find resources more efficiently by searching for specific keywords

There is currently one type of search that can be performed to find a specific user: a generic Filter-based search that follows a predefined matching logic. ## Filter-Search A filter search consists of specifying a `q` query parameter and a corresponding search value on a Collection Resource URL: [block:api-header] { "type": "basic", "title": "Example Search", "sidebar": true } [/block] [block:textarea] { "text": "**Request**", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "curl -i https://api.tapglue.com/0.2/users/search?q=criteria \\\n-u APP_TOKEN:SESSION_TOKEN \\\n-H 'Accept: application/json'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "**Response**", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\":\"8586b3fe-6c7d-5d77-8509-a8b587c8e1ee\",\n \"social_ids\":{\n \"abook\":\"acc-1-app-1-user-2-abk\",\n \"facebook\":\"acc-1-app-1-user-2-fb\",\n \"gplus\":\"acc-1-app-1-user-2-gpl\",\n \"twitter\":\"acc-1-app-1-user-2-tw\"\n },\n \"user_name\":\"acc-1-app-1-user-2\",\n \"first_name\":\"acc-1-app-1-user-2-first-name\",\n \"last_name\":\"acc-1-app-1-user-2-last-name\",\n \"email\":\"acc-1-app-1-user-2@tapglue-test.com\",\n \"url\":\"http://tapglue.com/users/1/demouser\",\n \"last_login\":\"2015-05-18T09:59:34.602+02:00\",\n \"activated\":true,\n \"metadata\":{\n \"customData\":\"customValue\"\n },\n \"image\":[\n {\n \"url\":\"http://images.tapglue.com/1/demouser/profile.jpg\"\n }\n ],\n \"created_at\":\"2015-05-18T09:59:34.75+02:00\",\n \"updated_at\":\"2015-05-18T09:59:34.92+02:00\",\n \"enabled\":true\n }\n]", "language": "json" } ], "sidebar": true } [/block] **Matching Logic** If the entered criteria, through a case-insensitive comparison, exists within (or is equal to) any viewable attribute on an instance in the collection, that instance is included in the query results. This returns all users where: - The `user_name` equals or contains ‘criteria’ (case insensitive) OR - The `first_name` equals or contains ‘criteria’ (case insensitive) OR - The `last_name` equals or contains ‘criteria’ (case insensitive) OR - The `email` equals or contains ‘criteria’ (case insensitive) etc.
There is currently one type of search that can be performed to find a specific user: a generic Filter-based search that follows a predefined matching logic. ## Filter-Search A filter search consists of specifying a `q` query parameter and a corresponding search value on a Collection Resource URL: [block:api-header] { "type": "basic", "title": "Example Search", "sidebar": true } [/block] [block:textarea] { "text": "**Request**", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "curl -i https://api.tapglue.com/0.2/users/search?q=criteria \\\n-u APP_TOKEN:SESSION_TOKEN \\\n-H 'Accept: application/json'", "language": "curl" } ], "sidebar": true } [/block] [block:textarea] { "text": "**Response**", "sidebar": true } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\":\"8586b3fe-6c7d-5d77-8509-a8b587c8e1ee\",\n \"social_ids\":{\n \"abook\":\"acc-1-app-1-user-2-abk\",\n \"facebook\":\"acc-1-app-1-user-2-fb\",\n \"gplus\":\"acc-1-app-1-user-2-gpl\",\n \"twitter\":\"acc-1-app-1-user-2-tw\"\n },\n \"user_name\":\"acc-1-app-1-user-2\",\n \"first_name\":\"acc-1-app-1-user-2-first-name\",\n \"last_name\":\"acc-1-app-1-user-2-last-name\",\n \"email\":\"acc-1-app-1-user-2@tapglue-test.com\",\n \"url\":\"http://tapglue.com/users/1/demouser\",\n \"last_login\":\"2015-05-18T09:59:34.602+02:00\",\n \"activated\":true,\n \"metadata\":{\n \"customData\":\"customValue\"\n },\n \"image\":[\n {\n \"url\":\"http://images.tapglue.com/1/demouser/profile.jpg\"\n }\n ],\n \"created_at\":\"2015-05-18T09:59:34.75+02:00\",\n \"updated_at\":\"2015-05-18T09:59:34.92+02:00\",\n \"enabled\":true\n }\n]", "language": "json" } ], "sidebar": true } [/block] **Matching Logic** If the entered criteria, through a case-insensitive comparison, exists within (or is equal to) any viewable attribute on an instance in the collection, that instance is included in the query results. This returns all users where: - The `user_name` equals or contains ‘criteria’ (case insensitive) OR - The `first_name` equals or contains ‘criteria’ (case insensitive) OR - The `last_name` equals or contains ‘criteria’ (case insensitive) OR - The `email` equals or contains ‘criteria’ (case insensitive) etc.
{"__v":1,"_id":"553f83a06a7d010d0057c825","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":""},"body":"User objects are the main entities to identify the users of your app. If the user doesn't already exist in your app, you need to create them first in order to track events or provide a feed.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`id`\",\n    \"0-1\": \"integer\",\n    \"0-2\": \"Unique user identifier from us\",\n    \"1-0\": \"`custom_id`\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Unique user identifier from you\",\n    \"h-3\": \"Required\",\n    \"2-3\": \"\",\n    \"2-0\": \"`social_ids`\",\n    \"2-1\": \"map[string]string\",\n    \"2-2\": \"List of ids for social networks\",\n    \"3-3\": \"✔\",\n    \"3-0\": \"`user_name`\",\n    \"3-2\": \"Username\",\n    \"3-1\": \"string\",\n    \"4-0\": \"`password`\",\n    \"4-1\": \"string\",\n    \"4-2\": \"User password\",\n    \"5-0\": \"`first_name`\",\n    \"5-1\": \"string\",\n    \"5-2\": \"First name of the user\",\n    \"6-0\": \"`last_name`\",\n    \"6-1\": \"string\",\n    \"6-2\": \"Last name of the user\",\n    \"7-0\": \"`email`\",\n    \"7-1\": \"string\",\n    \"7-2\": \"Email address of the user\",\n    \"8-0\": \"`url`\",\n    \"8-1\": \"string\",\n    \"8-2\": \"URL to the user profile in the app**\",\n    \"9-0\": \"`metadata`\",\n    \"9-1\": \"string\",\n    \"9-2\": \"Custom payload associated with the user\",\n    \"10-0\": \"`activated`\",\n    \"10-1\": \"bool\",\n    \"10-2\": \"Optional status for user accounts\",\n    \"4-3\": \"✔\",\n    \"7-3\": \"✔\"\n  },\n  \"cols\": 4,\n  \"rows\": 11\n}\n[/block]","category":"553f839f6a7d010d0057c80b","createdAt":"2015-04-23T10:02:07.542Z","excerpt":"User objects allow you to track users and associated events in your app.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"5538be9dfd56310d00b173d0","slug":"users","sync_unique":"","title":"The User Object","type":"basic","updates":["55489a1bafc5ed0d00e14538"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

The User Object

User objects allow you to track users and associated events in your app.

User objects are the main entities to identify the users of your app. If the user doesn't already exist in your app, you need to create them first in order to track events or provide a feed. [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Type", "h-2": "Description", "0-0": "`id`", "0-1": "integer", "0-2": "Unique user identifier from us", "1-0": "`custom_id`", "1-1": "string", "1-2": "Unique user identifier from you", "h-3": "Required", "2-3": "", "2-0": "`social_ids`", "2-1": "map[string]string", "2-2": "List of ids for social networks", "3-3": "✔", "3-0": "`user_name`", "3-2": "Username", "3-1": "string", "4-0": "`password`", "4-1": "string", "4-2": "User password", "5-0": "`first_name`", "5-1": "string", "5-2": "First name of the user", "6-0": "`last_name`", "6-1": "string", "6-2": "Last name of the user", "7-0": "`email`", "7-1": "string", "7-2": "Email address of the user", "8-0": "`url`", "8-1": "string", "8-2": "URL to the user profile in the app**", "9-0": "`metadata`", "9-1": "string", "9-2": "Custom payload associated with the user", "10-0": "`activated`", "10-1": "bool", "10-2": "Optional status for user accounts", "4-3": "✔", "7-3": "✔" }, "cols": 4, "rows": 11 } [/block]
User objects are the main entities to identify the users of your app. If the user doesn't already exist in your app, you need to create them first in order to track events or provide a feed. [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Type", "h-2": "Description", "0-0": "`id`", "0-1": "integer", "0-2": "Unique user identifier from us", "1-0": "`custom_id`", "1-1": "string", "1-2": "Unique user identifier from you", "h-3": "Required", "2-3": "", "2-0": "`social_ids`", "2-1": "map[string]string", "2-2": "List of ids for social networks", "3-3": "✔", "3-0": "`user_name`", "3-2": "Username", "3-1": "string", "4-0": "`password`", "4-1": "string", "4-2": "User password", "5-0": "`first_name`", "5-1": "string", "5-2": "First name of the user", "6-0": "`last_name`", "6-1": "string", "6-2": "Last name of the user", "7-0": "`email`", "7-1": "string", "7-2": "Email address of the user", "8-0": "`url`", "8-1": "string", "8-2": "URL to the user profile in the app**", "9-0": "`metadata`", "9-1": "string", "9-2": "Custom payload associated with the user", "10-0": "`activated`", "10-1": "bool", "10-2": "Optional status for user accounts", "4-3": "✔", "7-3": "✔" }, "cols": 4, "rows": 11 } [/block]
{"__v":0,"_id":"553f83a06a7d010d0057c828","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/users \\\n    -u APP_TOKEN: \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json' \\\n    -H 'Content-Type: application/json' \\\n    -d '{\"user_name\":\"Demo User\", \"first_name\":\"John\", \"last_name\": \"Smith\", \"email\":\"js@m.o\", \"password\": \"password\"}'"},{"code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"content-type\": @\"application/json\",\n    @\"authorization\": authValue };\nNSDictionary *parameters = @{\n  \t@\"user_name\": @\"Demo User\",\n    @\"first_name\": @\"John\",\n    @\"last_name\": @\"Smith\",\n    @\"email\": @\"js@m.o\",\n    @\"password\": @\"password\" };\n\nNSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/users\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"POST\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];","language":"objectivec"},{"code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"content-type\": \"application/json\",\n  \"authorization\": authString\n]\nlet parameters = [\n  \"user_name\": \"Demo User\",\n  \"first_name\": \"John\",\n  \"last_name\": \"Smith\",\n  \"email\": \"js@m.o\",\n  \"password\": \"password\"\n]\n\nlet postData = NSJSONSerialization.dataWithJSONObject(parameters, options: nil, error: nil)\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/users\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()","language":"objectivec","name":"Swift"},{"code":"OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"user_name\\\":\\\"Demo User\\\", \\\"first_name\\\":\\\"John\\\", \\\"last_name\\\": \\\"Smith\\\", \\\"email\\\":\\\"js@m.o\\\", \\\"password\\\": \\\"password\\\"}\");\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/users\")\n  .post(body)\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"content-type\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:\")\n  .build();\n\nResponse response = client.newCall(request)cute();","language":"java"},{"code":"var client = new RestClient(/api.tapglue.com/0.2/users\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{\\\"user_name\\\":\\\"Demo User\\\", \\\"first_name\\\":\\\"John\\\", \\\"last_name\\\": \\\"Smith\\\", \\\"email\\\":\\\"js@m.o\\\", \\\"password\\\": \\\"password\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);","language":"csharp"}]},"params":[{"_id":"553e545d8feab90d0059d8c6","required":true,"desc":"Username","default":"","type":"string","name":"user_name"},{"_id":"553e545d8feab90d0059d8c8","required":false,"desc":"Unique user identifier from you","default":"","type":"string","name":"custom_id"},{"_id":"553e545d8feab90d0059d8c7","required":false,"desc":"List of ids for social networks","default":"","type":"array_string","name":"social_ids"},{"_id":"553e545d8feab90d0059d8c5","required":false,"desc":"User password","default":"","type":"string","name":"password"},{"_id":"553e545d8feab90d0059d8c4","required":false,"desc":"First name of the user","default":"","type":"string","name":"first_name"},{"_id":"553e545d8feab90d0059d8c3","required":false,"desc":"Last name of the user","default":"","type":"string","name":"last_name"},{"_id":"553e545d8feab90d0059d8c2","required":false,"desc":"Email address of the user","default":"","type":"string","name":"email"},{"_id":"553e545d8feab90d0059d8c1","required":false,"desc":"URL to the user profile in the app","default":"","type":"string","name":"url"},{"_id":"553e545d8feab90d0059d8c0","default":"","desc":"Custom payload associated with the user","name":"metadata","required":false,"type":"object"},{"_id":"553e545d8feab90d0059d8bf","required":false,"desc":"Status for user accounts","default":"","type":"string","name":"activated"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"id\":1,\n    \"user_name\":\"Demo User\",\n    \"first_name\":\"John\",\n    \"last_name\":\"Smith\",\n    \"email\":\"j8s@m.o\",\n    \"last_login\":\"0000-01-01T00:00:00Z\",\n    \"enabled\":true,\n    \"created_at\":\"2015-03-20T18:15:40.8+01:00\",\n    \"updated_at\":\"2015-03-20T18:15:40.8+01:00\"\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/users"},"body":"## Create and Login User\n\nIf you want to create the user and automatically login afterwards you can simple attach `withLogin=true` to the login endpoint.\n\n**Example Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -i https://api.tapglue.com/0.2/users?withLogin=true \\\\\\n-u APP_TOKEN: \\\\\\n-H \\\"User-Agent: Tapglue Test UA\\\" \\\\\\n-H \\\"Content-Type: application/json\\\" \\\\\\n-H \\\"Content-Length: 168\\\" \\\\\\n-d '{\\\"user_name\\\":\\\"demouser\\\", \\\"first_name\\\":\\\"Demo\\\", \\\"last_name\\\": \\\"User\\\", \\\"email\\\": \\\"user@tapglue.com\\\", \\\"url\\\": \\\"http://tapglue.com/users/1/demouser\\\", \\\"password\\\": \\\"password\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"id\\\":\\\"8b0bb04f-c051-5412-a433-2905c7220906\\\",\\n   \\\"user_name\\\":\\\"demouseras\\\",\\n   \\\"first_name\\\":\\\"Demo\\\",\\n   \\\"last_name\\\":\\\"User\\\",\\n   \\\"email\\\":\\\"useasr@tapglue.com\\\",\\n   \\\"url\\\":\\\"http://tapglue.com/users/1/demouser\\\",\\n   \\\"last_login\\\":\\\"2015-05-18T10:52:51.07+02:00\\\",\\n   \\\"activated\\\":true,\\n   \\\"created_at\\\":\\\"2015-05-18T10:52:51.59+02:00\\\",\\n   \\\"updated_at\\\":\\\"2015-05-18T10:52:51.59+02:00\\\",\\n   \\\"enabled\\\":true,\\n   \\\"session_token\\\":\\\"JDZHczpvfXRKNigyRXlYd0tjPnQ=\\\"\\n}\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","category":"553f839f6a7d010d0057c80b","createdAt":"2015-04-27T15:11:16.690Z","excerpt":"Create users in your app, when they are seen for the first time.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"5538be9dfd56310d00b173d0","slug":"create-user","sync_unique":"","title":"Create User","type":"post","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

postCreate User

Create users in your app, when they are seen for the first time.

user_name:
required
String
Username
custom_id:
String
Unique user identifier from you
social_ids:
Array of Strings
List of ids for social networks
password:
String
User password
first_name:
String
First name of the user
last_name:
String
Last name of the user
email:
String
Email address of the user
url:
String
URL to the user profile in the app
metadata:
Object
Custom payload associated with the user
activated:
String
Status for user accounts
## Create and Login User If you want to create the user and automatically login afterwards you can simple attach `withLogin=true` to the login endpoint. **Example Request** [block:code] { "codes": [ { "code": "curl -i https://api.tapglue.com/0.2/users?withLogin=true \\\n-u APP_TOKEN: \\\n-H \"User-Agent: Tapglue Test UA\" \\\n-H \"Content-Type: application/json\" \\\n-H \"Content-Length: 168\" \\\n-d '{\"user_name\":\"demouser\", \"first_name\":\"Demo\", \"last_name\": \"User\", \"email\": \"user@tapglue.com\", \"url\": \"http://tapglue.com/users/1/demouser\", \"password\": \"password\"}'", "language": "curl" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"id\":\"8b0bb04f-c051-5412-a433-2905c7220906\",\n \"user_name\":\"demouseras\",\n \"first_name\":\"Demo\",\n \"last_name\":\"User\",\n \"email\":\"useasr@tapglue.com\",\n \"url\":\"http://tapglue.com/users/1/demouser\",\n \"last_login\":\"2015-05-18T10:52:51.07+02:00\",\n \"activated\":true,\n \"created_at\":\"2015-05-18T10:52:51.59+02:00\",\n \"updated_at\":\"2015-05-18T10:52:51.59+02:00\",\n \"enabled\":true,\n \"session_token\":\"JDZHczpvfXRKNigyRXlYd0tjPnQ=\"\n}", "language": "curl" } ] } [/block]
## Create and Login User If you want to create the user and automatically login afterwards you can simple attach `withLogin=true` to the login endpoint. **Example Request** [block:code] { "codes": [ { "code": "curl -i https://api.tapglue.com/0.2/users?withLogin=true \\\n-u APP_TOKEN: \\\n-H \"User-Agent: Tapglue Test UA\" \\\n-H \"Content-Type: application/json\" \\\n-H \"Content-Length: 168\" \\\n-d '{\"user_name\":\"demouser\", \"first_name\":\"Demo\", \"last_name\": \"User\", \"email\": \"user@tapglue.com\", \"url\": \"http://tapglue.com/users/1/demouser\", \"password\": \"password\"}'", "language": "curl" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"id\":\"8b0bb04f-c051-5412-a433-2905c7220906\",\n \"user_name\":\"demouseras\",\n \"first_name\":\"Demo\",\n \"last_name\":\"User\",\n \"email\":\"useasr@tapglue.com\",\n \"url\":\"http://tapglue.com/users/1/demouser\",\n \"last_login\":\"2015-05-18T10:52:51.07+02:00\",\n \"activated\":true,\n \"created_at\":\"2015-05-18T10:52:51.59+02:00\",\n \"updated_at\":\"2015-05-18T10:52:51.59+02:00\",\n \"enabled\":true,\n \"session_token\":\"JDZHczpvfXRKNigyRXlYd0tjPnQ=\"\n}", "language": "curl" } ] } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":1,"_id":"553f83a06a7d010d0057c829","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user \\\n    -X PUT \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json' \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"user_name\":\"Demo User\", \"first_name\":\"John\", \"last_name\": \"Smith\", \"email\":\"js@m.o\", \"password\": \"password\"}'","name":""},{"name":null,"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"content-type\": @\"application/json\",\n    @\"authorization\": authValue };\nNSDictionary *parameters = @{\n  \t@\"user_name\": @\"Demo User\",\n    @\"first_name\": @\"John\",\n   \t@\"last_name\": @\"Smith\",\n   \t@\"email\": @\"js@m.o\",\n    @\"password\": @\"password\" };\n\nNSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"PUT\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"content-type\": \"application/json\",\n  \"authorization\": authString\n]\nlet parameters = [\n  \"user_name\": \"Demo User\",\n  \"first_name\": \"John\",\n  \"last_name\": \"Smith\",\n  \"email\": \"js@m.o\",\n  \"password\": \"password\"\n]\n\nlet postData = NSJSONSerialization.dataWithJSONObject(parameters, options: nil, error: nil)\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"PUT\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"user_name\\\":\\\"Demo User\\\", \\\"first_name\\\":\\\"John\\\", \\\"last_name\\\": \\\"Smith\\\", \\\"email\\\":\\\"js@m.o\\\", \\\"password\\\": \\\"password\\\"}\");\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user\")\n  .put(body)\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"content-type\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user\");\nvar request = new RestRequest(Method.PUT);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{\\\"user_name\\\":\\\"Demo User\\\", \\\"first_name\\\":\\\"John\\\", \\\"last_name\\\": \\\"Smith\\\", \\\"email\\\":\\\"js@m.o\\\", \\\"password\\\": \\\"password\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f3f1f76155d0d0050842a","required":true,"desc":"Username","default":"","type":"string","name":"user_name"},{"_id":"553f3f1f76155d0d00508429","required":false,"desc":"Unique user identifier from you","default":"","type":"string","name":"custom_id"},{"_id":"553f3f1f76155d0d00508428","required":false,"desc":"List of ids for social networks","default":"","type":"array_string","name":"social_ids"},{"_id":"553f3f1f76155d0d00508427","required":false,"desc":"User password","default":"","type":"string","name":"password"},{"_id":"553f3f1f76155d0d00508426","required":false,"desc":"First name of the user","default":"","type":"string","name":"first_name"},{"_id":"553f3f1f76155d0d00508425","required":false,"desc":"Last name of the user","default":"","type":"string","name":"last_name"},{"_id":"553f3f1f76155d0d00508424","required":false,"desc":"Email address of the user","default":"","type":"string","name":"email"},{"_id":"553f3f1f76155d0d00508423","required":false,"desc":"URL to the user profile in the app","default":"","type":"string","name":"url"},{"_id":"553f3f1f76155d0d00508422","required":false,"desc":"Custom payload associated with the user","default":"","type":"object","name":"metadata"},{"_id":"553f3f1f76155d0d00508421","required":false,"desc":"Status of the user accounts","default":"","type":"string","name":"activated"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"id\":1,\n    \"user_name\":\"Demo User\",\n    \"first_name\":\"John\",\n    \"last_name\":\"Smith\",\n    \"email\":\"j8s@m.o\",\n    \"last_login\":\"0000-01-01T00:00:00Z\",\n    \"enabled\":true,\n    \"created_at\":\"2015-03-20T18:15:40.8+01:00\",\n    \"updated_at\":\"2015-03-20T18:15:40.8+01:00\"\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user"},"body":"","category":"553f839f6a7d010d0057c80b","createdAt":"2015-04-27T19:21:31.353Z","excerpt":"Update user information, when editing their profile for example.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"project":"5538be9dfd56310d00b173d0","slug":"update-user","sync_unique":"","title":"Update User","type":"put","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

putUpdate User

Update user information, when editing their profile for example.

user_name:
required
String
Username
custom_id:
String
Unique user identifier from you
social_ids:
Array of Strings
List of ids for social networks
password:
String
User password
first_name:
String
First name of the user
last_name:
String
Last name of the user
email:
String
Email address of the user
url:
String
URL to the user profile in the app
metadata:
Object
Custom payload associated with the user
activated:
String
Status of the user accounts

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":8,"_id":"553f83a06a7d010d0057c82a","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user \\\n    -X DELETE \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"DELETE\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"DELETE\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user\")\n  .delete(null)\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user\");\nvar request = new RestRequest(Method.DELETE);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[],"results":{"codes":[{"status":204,"language":"json","code":"","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user"},"body":"[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Deleting Users\",\n  \"body\": \"Deleting users will lead to the deletion of the users events from the news feed of previously connected users as well.\"\n}\n[/block]","category":"553f839f6a7d010d0057c80b","createdAt":"2015-04-27T19:23:22.533Z","excerpt":"Deleting user accounts if a user wants to cancel their account.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"project":"5538be9dfd56310d00b173d0","slug":"delete-user","sync_unique":"","title":"Delete User","type":"delete","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

deleteDelete User

Deleting user accounts if a user wants to cancel their account.

[block:callout] { "type": "danger", "title": "Deleting Users", "body": "Deleting users will lead to the deletion of the users events from the news feed of previously connected users as well." } [/block]
[block:callout] { "type": "danger", "title": "Deleting Users", "body": "Deleting users will lead to the deletion of the users events from the news feed of previously connected users as well." } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples

{"__v":9,"_id":"553f83a06a7d010d0057c82b","api":{"auth":"required","examples":{"codes":[{"name":"","code":"curl https://api.tapglue.com/0.2/user \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","language":"curl"},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user\");\nvar request = new RestRequest(Method.DELETE);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[],"results":{"codes":[{"name":"","code":"{\n    \"id\":1,\n    \"user_name\":\"Demo User\",\n    \"first_name\":\"John\",\n    \"last_name\":\"Smith\",\n    \"email\":\"j8s@m.o\",\n    \"last_login\":\"0000-01-01T00:00:00Z\",\n    \"enabled\":true,\n    \"created_at\":\"2015-03-20T18:15:40.8+01:00\",\n    \"updated_at\":\"2015-03-20T18:15:40.8+01:00\"\n}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"url":"/user"},"body":"","category":"553f839f6a7d010d0057c80b","createdAt":"2015-04-27T19:23:50.378Z","excerpt":"Retrieve current users information to show on a profile screen.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":4,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-current-users","sync_unique":"","title":"Retrieve Current User","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Current User

Retrieve current users information to show on a profile screen.

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":0,"_id":"554738ed6184460d006fd853","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/users/1 \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/users/1\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/users/1\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/users/1\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/users/1\");\nvar request = new RestRequest(Method.DELETE);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"554738ed6184460d006fd854","default":"URI Parameter","desc":"Unique user identifier","name":"UserID","required":true,"type":"string"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"id\":1,\n    \"user_name\":\"Demo User\",\n    \"first_name\":\"John\",\n    \"last_name\":\"Smith\",\n    \"email\":\"j8s@m.o\",\n    \"last_login\":\"0000-01-01T00:00:00Z\",\n    \"enabled\":true,\n    \"created_at\":\"2015-03-20T18:15:40.8+01:00\",\n    \"updated_at\":\"2015-03-20T18:15:40.8+01:00\"\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/users/:UserID"},"body":"","category":"553f839f6a7d010d0057c80b","createdAt":"2015-05-04T09:16:29.063Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":5,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-user","sync_unique":"","title":"Retrieve User","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve User


UserID:
required
StringURI Parameter
Unique user identifier

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":0,"_id":"553f83a06a7d010d0057c82c","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/login \\\n    -u APP_TOKEN: \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json' \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"email\": \"js@m.o\", \"password\": \"password\"}'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"content-type\": @\"application/json\",\n    @\"authorization\": authValue };\nNSDictionary *parameters = @{\n  \t@\"email\": @\"js@m.o\",\n    @\"password\": @\"password\" };\n\nNSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/login\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"POST\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"content-type\": \"application/json\",\n  \"authorization\": authString\n]\nlet parameters = [\n  \"email\": \"js@m.o\",\n  \"password\": \"password\"\n]\n\nlet postData = NSJSONSerialization.dataWithJSONObject(parameters, options: nil, error: nil)\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/login\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"email\\\": \\\"js@m.o\\\", \\\"password\\\": \\\"password\\\"}\");\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/login\")\n  .post(body)\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"content-type\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/login\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{\\\"email\\\": \\\"js@m.o\\\", \\\"password\\\": \\\"password\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f3fc06a7d010d0057c77c","required":false,"desc":"Username","default":"","type":"string","name":"user_name"},{"_id":"553f3fc06a7d010d0057c77b","required":false,"desc":"Email address of the user","default":"","type":"string","name":"email"},{"_id":"553f3fc06a7d010d0057c77a","required":true,"desc":"User password","default":"","type":"string","name":"password"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"id\":\"d646f602-6722-5b62-bb39-2900914bb340\",\n    \"session_token\":\"fjBeO1FvXnFTaVF5fG1LaEpjWS0=\"\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/login"},"body":"## Login with User Details\n\nIf you want to retrieve the user information after the login you can simple attach `withUserDetails=true` to the login endpoint.\n\n**Example Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -i https://api.tapglue.com/0.2/user/login?withUserDetails=true  \\\\\\n-u APP_TOKEN:SESSION_TOKEN \\\\\\n-H \\\"User-Agent: Tapglue Test UA\\\" \\\\\\n-H \\\"Content-Type: application/json\\\" \\\\\\n-H \\\"Content-Length: 82\\\" \\\\\\n-d '{\\\"email\\\": \\\"user-1@tapglue-test.com\\\", \\\"password\\\": \\\"user-1\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"social_ids\\\":{\\n      \\\"abook\\\":\\\"user-1-abk\\\",\\n      \\\"facebook\\\":\\\"user-1-fb\\\",\\n      \\\"gplus\\\":\\\"user-1-gpl\\\",\\n      \\\"twitter\\\":\\\"user-1-tw\\\"\\n   },\\n   \\\"user_name\\\":\\\"user-1\\\",\\n   \\\"first_name\\\":\\\"user-1-first-name\\\",\\n   \\\"last_name\\\":\\\"user-1-last-name\\\",\\n   \\\"email\\\":\\\"user-1@tapglue-test.com\\\",\\n   \\\"url\\\":\\\"http://tapglue.com/users/1/demouser\\\",\\n   \\\"last_login\\\":\\\"2015-05-18T13:27:05.804581626+02:00\\\",\\n   \\\"activated\\\":true,\\n   \\\"metadata\\\":{\\n      \\\"customData\\\":\\\"customValue\\\"\\n   },\\n   \\\"image\\\":[\\n      {\\n         \\\"url\\\":\\\"http://images.tapglue.com/1/demouser/profile.jpg\\\"\\n      }\\n   ],\\n   \\\"created_at\\\":\\\"2015-05-18T13:26:02.54+02:00\\\",\\n   \\\"updated_at\\\":\\\"2015-05-18T13:26:02.67+02:00\\\",\\n   \\\"enabled\\\":true,\\n   \\\"id\\\":\\\"d646f602-6722-5b62-bb39-2900914bb340\\\",\\n   \\\"session_token\\\":\\\"fjBeO1FvXnFTaVF5fG1LaEpjWS0=\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","category":"553f839f6a7d010d0057c80b","createdAt":"2015-04-27T19:25:31.177Z","excerpt":"Login users will generate a valid session token if you're using our user management.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":6,"project":"5538be9dfd56310d00b173d0","slug":"login-user","sync_unique":"","title":"Login User","type":"post","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

postLogin User

Login users will generate a valid session token if you're using our user management.

user_name:
String
Username
email:
String
Email address of the user
password:
required
String
User password
## Login with User Details If you want to retrieve the user information after the login you can simple attach `withUserDetails=true` to the login endpoint. **Example Request** [block:code] { "codes": [ { "code": "curl -i https://api.tapglue.com/0.2/user/login?withUserDetails=true \\\n-u APP_TOKEN:SESSION_TOKEN \\\n-H \"User-Agent: Tapglue Test UA\" \\\n-H \"Content-Type: application/json\" \\\n-H \"Content-Length: 82\" \\\n-d '{\"email\": \"user-1@tapglue-test.com\", \"password\": \"user-1\"}'", "language": "curl" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"social_ids\":{\n \"abook\":\"user-1-abk\",\n \"facebook\":\"user-1-fb\",\n \"gplus\":\"user-1-gpl\",\n \"twitter\":\"user-1-tw\"\n },\n \"user_name\":\"user-1\",\n \"first_name\":\"user-1-first-name\",\n \"last_name\":\"user-1-last-name\",\n \"email\":\"user-1@tapglue-test.com\",\n \"url\":\"http://tapglue.com/users/1/demouser\",\n \"last_login\":\"2015-05-18T13:27:05.804581626+02:00\",\n \"activated\":true,\n \"metadata\":{\n \"customData\":\"customValue\"\n },\n \"image\":[\n {\n \"url\":\"http://images.tapglue.com/1/demouser/profile.jpg\"\n }\n ],\n \"created_at\":\"2015-05-18T13:26:02.54+02:00\",\n \"updated_at\":\"2015-05-18T13:26:02.67+02:00\",\n \"enabled\":true,\n \"id\":\"d646f602-6722-5b62-bb39-2900914bb340\",\n \"session_token\":\"fjBeO1FvXnFTaVF5fG1LaEpjWS0=\"\n}", "language": "json" } ] } [/block]
## Login with User Details If you want to retrieve the user information after the login you can simple attach `withUserDetails=true` to the login endpoint. **Example Request** [block:code] { "codes": [ { "code": "curl -i https://api.tapglue.com/0.2/user/login?withUserDetails=true \\\n-u APP_TOKEN:SESSION_TOKEN \\\n-H \"User-Agent: Tapglue Test UA\" \\\n-H \"Content-Type: application/json\" \\\n-H \"Content-Length: 82\" \\\n-d '{\"email\": \"user-1@tapglue-test.com\", \"password\": \"user-1\"}'", "language": "curl" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"social_ids\":{\n \"abook\":\"user-1-abk\",\n \"facebook\":\"user-1-fb\",\n \"gplus\":\"user-1-gpl\",\n \"twitter\":\"user-1-tw\"\n },\n \"user_name\":\"user-1\",\n \"first_name\":\"user-1-first-name\",\n \"last_name\":\"user-1-last-name\",\n \"email\":\"user-1@tapglue-test.com\",\n \"url\":\"http://tapglue.com/users/1/demouser\",\n \"last_login\":\"2015-05-18T13:27:05.804581626+02:00\",\n \"activated\":true,\n \"metadata\":{\n \"customData\":\"customValue\"\n },\n \"image\":[\n {\n \"url\":\"http://images.tapglue.com/1/demouser/profile.jpg\"\n }\n ],\n \"created_at\":\"2015-05-18T13:26:02.54+02:00\",\n \"updated_at\":\"2015-05-18T13:26:02.67+02:00\",\n \"enabled\":true,\n \"id\":\"d646f602-6722-5b62-bb39-2900914bb340\",\n \"session_token\":\"fjBeO1FvXnFTaVF5fG1LaEpjWS0=\"\n}", "language": "json" } ] } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":8,"_id":"553f83a06a7d010d0057c82d","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/logout \\\n\t\t-X DELETE \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/logout\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"DELETE\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/logout\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"DELETE\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/logout\")\n  .delete(null)\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/logout\");\nvar request = new RestRequest(Method.DELETE);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[],"results":{"codes":[{"status":204,"language":"json","code":"","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/logout"},"body":"","category":"553f839f6a7d010d0057c80b","createdAt":"2015-04-27T19:26:11.438Z","excerpt":"Logging out users will destroy the session token.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":7,"project":"5538be9dfd56310d00b173d0","slug":"logout-user","sync_unique":"","title":"Logout User","type":"delete","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

deleteLogout User

Logging out users will destroy the session token.

Definition

{{ api_url }}{{ page_api_url }}

Examples

{"__v":3,"_id":"553f83a06a7d010d0057c826","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Connections are the key to your social graph. We allow you to create follow or friend connections between your users.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"h-3\": \"Required\",\n    \"0-0\": \"`user_from_id`\",\n    \"0-1\": \"integer\",\n    \"1-0\": \"`user_to_id`\",\n    \"1-1\": \"integer\",\n    \"0-3\": \"✔\",\n    \"1-3\": \"✔\",\n    \"2-0\": \"`type`\",\n    \"2-1\": \"string\",\n    \"0-2\": \"Unique user identifier of the user the connection is going from\",\n    \"1-2\": \"Unique user identifier of the user the connection is going to\",\n    \"2-2\": \"Define type of connection (`friend` or `follow`)\",\n    \"2-3\": \"✔\",\n    \"3-0\": \"`confirmed_at`\",\n    \"3-1\": \"timestamp\",\n    \"3-2\": \"Timestamp the connection was confirmed (friends only)\"\n  },\n  \"cols\": 4,\n  \"rows\": 4\n}\n[/block]\n### Friend vs. Follow\n\nWe allow you to create follow or friend connections between your users. Just specify the type to `follow` or `friend` and let us handle the rest.","category":"553f839f6a7d010d0057c80c","createdAt":"2015-04-23T10:02:22.066Z","excerpt":"Start building your social graph with connections to be more powerful.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"5538be9dfd56310d00b173d0","slug":"connections","sync_unique":"","title":"The Connection Object","type":"basic","updates":["55489aabb2581a0d0091407c"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

The Connection Object

Start building your social graph with connections to be more powerful.

Connections are the key to your social graph. We allow you to create follow or friend connections between your users. [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Type", "h-2": "Description", "h-3": "Required", "0-0": "`user_from_id`", "0-1": "integer", "1-0": "`user_to_id`", "1-1": "integer", "0-3": "✔", "1-3": "✔", "2-0": "`type`", "2-1": "string", "0-2": "Unique user identifier of the user the connection is going from", "1-2": "Unique user identifier of the user the connection is going to", "2-2": "Define type of connection (`friend` or `follow`)", "2-3": "✔", "3-0": "`confirmed_at`", "3-1": "timestamp", "3-2": "Timestamp the connection was confirmed (friends only)" }, "cols": 4, "rows": 4 } [/block] ### Friend vs. Follow We allow you to create follow or friend connections between your users. Just specify the type to `follow` or `friend` and let us handle the rest.
Connections are the key to your social graph. We allow you to create follow or friend connections between your users. [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Type", "h-2": "Description", "h-3": "Required", "0-0": "`user_from_id`", "0-1": "integer", "1-0": "`user_to_id`", "1-1": "integer", "0-3": "✔", "1-3": "✔", "2-0": "`type`", "2-1": "string", "0-2": "Unique user identifier of the user the connection is going from", "1-2": "Unique user identifier of the user the connection is going to", "2-2": "Define type of connection (`friend` or `follow`)", "2-3": "✔", "3-0": "`confirmed_at`", "3-1": "timestamp", "3-2": "Timestamp the connection was confirmed (friends only)" }, "cols": 4, "rows": 4 } [/block] ### Friend vs. Follow We allow you to create follow or friend connections between your users. Just specify the type to `follow` or `friend` and let us handle the rest.
{"__v":1,"_id":"553f83a06a7d010d0057c80e","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/connections \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json' \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"user_to_id\":3, \"type\":\"follow\"}'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"content-type\": @\"application/json\",\n    @\"authorization\": authValue };\nNSDictionary *parameters = @{\n  \t@\"user_to_id\": @3,\n    @\"type\": @\"follow\" };\n\nNSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/connections\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"POST\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"content-type\": \"application/json\",\n  \"authorization\": authString\n]\nlet parameters = [\n  \"user_to_id\": 3,\n  \"type\": \"follow\"\n]\n\nlet postData = NSJSONSerialization.dataWithJSONObject(parameters, options: nil, error: nil)\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/connections\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"user_to_id\\\":3, \\\"type\\\":\\\"follow\\\"}\");\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/connections\")\n  .post(body)\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"content-type\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/connections\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{\\\"user_to_id\\\":3, \\\"type\\\":\\\"follow\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f47f276155d0d00508444","default":"","desc":"Unique user identifier the connection points to","name":"user_to_id","required":true,"type":"string"},{"_id":"553f47f276155d0d00508443","required":false,"desc":"Type of connection","default":"follow, friend","type":"string","name":"type"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"user_from_id\":1,\n    \"user_to_id\":3,\n    \"type\":\"follow\",\n    \"enabled\":true,\n    \"created_at\":\"2015-03-21T09:22:10.5+01:00\",\n    \"updated_at\":\"2015-03-21T09:22:10.5+01:00\"\n}","name":null},{"status":400,"language":"text","code":""}]},"url":"/user/connections"},"body":"","category":"553f839f6a7d010d0057c80c","createdAt":"2015-04-27T19:28:56.571Z","excerpt":"Create a follow or friend connection between two users.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"5538be9dfd56310d00b173d0","slug":"create-connection","sync_unique":"","title":"Create Connection","type":"post","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

postCreate Connection

Create a follow or friend connection between two users.

user_to_id:
required
String
Unique user identifier the connection points to
type:
Stringfollow, friend
Type of connection

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":1,"_id":"553f83a06a7d010d0057c80f","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/connections/3 \\\n    -X DELETE \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/connections/3\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"DELETE\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/connections/3\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"DELETE\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/connections/3\")\n  .delete(null)\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/connections/3\");\nvar request = new RestRequest(Method.DELETE);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f48b923c53c0d00cccc6f","required":true,"desc":"User identifier the connections goes to","default":"URI Parameter","type":"int","name":"UserID"}],"results":{"codes":[{"status":204,"language":"json","code":"","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/connections/:UserID"},"body":"","category":"553f839f6a7d010d0057c80c","createdAt":"2015-04-27T19:37:03.642Z","excerpt":"Delete a connection between users, in case a user unfollows another for example.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"project":"5538be9dfd56310d00b173d0","slug":"delete-connection","sync_unique":"","title":"Delete Connection","type":"delete","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

deleteDelete Connection

Delete a connection between users, in case a user unfollows another for example.

UserID:
required
IntegerURI Parameter
User identifier the connections goes to

Definition

{{ api_url }}{{ page_api_url }}

Examples

{"__v":6,"_id":"55473eae9a48800d00c6e45d","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/follows \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"name":"Objective-C","language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/follows\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/follows\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/follows\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/follows\");\nvar request = new RestRequest(Method.DELETE);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"[\n    {\n        \"id\":2,\n        \"user_name\":\"Demo1\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo1@m.o\",\n        \"last_login\":\"2015-03-18T11:09:49.4+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-18T11:07:42.3+01:00\",\n        \"updated_at\":\"2015-03-18T11:07:42.3+01:00\"\n    },\n    {\n        \"id\":3,\n        \"user_name\":\"Demo2\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo2@m.o\",\n        \"last_login\":\"2015-03-18T11:06:14.9+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-17T19:38:12.5+01:00\",\n        \"updated_at\":\"2015-03-17T19:38:12.5+01:00\"\n    }\n]","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/follows"},"body":"","category":"553f839f6a7d010d0057c80c","createdAt":"2015-05-04T09:41:02.865Z","excerpt":"Retrieve connections of the current user to show who they are following.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-current-user-follows","sync_unique":"","title":"Retrieve Current User Follows","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Current User Follows

Retrieve connections of the current user to show who they are following.

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":6,"_id":"55473f566184460d006fd87c","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/followers \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://api.tapglue.com/0.2/user/followers\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: \"https://api.tapglue.com/0.2/user/followers\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"import Foundation\n\nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": \"Basic APP_TOKEN:SESSION_TOKEN\"\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: \"https://api.tapglue.com/0.2/user/followers\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"csharp","code":"var client = new RestClient(\"https://api.tapglue.com/0.2/user/followers\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"[\n    {\n        \"id\":2,\n        \"user_name\":\"Demo1\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo1@m.o\",\n        \"last_login\":\"2015-03-18T11:09:49.4+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-18T11:07:42.3+01:00\",\n        \"updated_at\":\"2015-03-18T11:07:42.3+01:00\"\n    },\n    {\n        \"id\":3,\n        \"user_name\":\"Demo2\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo2@m.o\",\n        \"last_login\":\"2015-03-18T11:06:14.9+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-17T19:38:12.5+01:00\",\n        \"updated_at\":\"2015-03-17T19:38:12.5+01:00\"\n    }\n]","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/followers"},"body":"","category":"553f839f6a7d010d0057c80c","createdAt":"2015-05-04T09:43:50.100Z","excerpt":"Retrieve current users followers to display user who their followers are.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":4,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-current-user-followers","sync_unique":"","title":"Retrieve Current User Followers","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Current User Followers

Retrieve current users followers to display user who their followers are.

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":6,"_id":"55473fea6184460d006fd881","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/friends \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/friends\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/friends\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/friends\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(\"https://api.tapglue.com/0.2/user/followers\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"[\n    {\n        \"id\":2,\n        \"user_name\":\"Demo1\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo1@m.o\",\n        \"last_login\":\"2015-03-18T11:09:49.4+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-18T11:07:42.3+01:00\",\n        \"updated_at\":\"2015-03-18T11:07:42.3+01:00\"\n    },\n    {\n        \"id\":3,\n        \"user_name\":\"Demo2\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo2@m.o\",\n        \"last_login\":\"2015-03-18T11:06:14.9+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-17T19:38:12.5+01:00\",\n        \"updated_at\":\"2015-03-17T19:38:12.5+01:00\"\n    }\n]","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/friends"},"body":"","category":"553f839f6a7d010d0057c80c","createdAt":"2015-05-04T09:46:18.347Z","excerpt":"Retrieve friends of the current user.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":5,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-current-user-friends","sync_unique":"","title":"Retrieve Current User Friends","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Current User Friends

Retrieve friends of the current user.

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":0,"_id":"553f83a06a7d010d0057c810","api":{"auth":"required","examples":{"codes":[{"name":"","code":"curl https://api.tapglue.com/0.2/users/1/follows \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","language":"curl"},{"code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/users/1/follows\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];","language":"objectivec"},{"code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/users/1/follows\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()","language":"objectivec","name":"Swift"},{"code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/users/1/follows\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();","language":"java"},{"code":"var client = new RestClient(/api.tapglue.com/0.2/users/1/follows\");\nvar request = new RestRequest(Method.DELETE);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);","language":"csharp"}]},"params":[{"_id":"553f48d076155d0d0050844a","default":"","desc":"Unique user identifier","name":"UserID","required":true,"type":"int"}],"results":{"codes":[{"status":200,"language":"json","code":"[\n    {\n        \"id\":2,\n        \"user_name\":\"Demo1\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo1@m.o\",\n        \"last_login\":\"2015-03-18T11:09:49.4+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-18T11:07:42.3+01:00\",\n        \"updated_at\":\"2015-03-18T11:07:42.3+01:00\"\n    },\n    {\n        \"id\":3,\n        \"user_name\":\"Demo2\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo2@m.o\",\n        \"last_login\":\"2015-03-18T11:06:14.9+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-17T19:38:12.5+01:00\",\n        \"updated_at\":\"2015-03-17T19:38:12.5+01:00\"\n    }\n]","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/users/:UserID/followed"},"body":"","category":"553f839f6a7d010d0057c80c","createdAt":"2015-04-27T19:50:09.481Z","excerpt":"Retrieve connections of a user to show who they are following.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":6,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-follows","sync_unique":"","title":"Retrieve Follows","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Follows

Retrieve connections of a user to show who they are following.

UserID:
required
Integer
Unique user identifier

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":0,"_id":"553f83a06a7d010d0057c812","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/users/1/followers \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/users/1/followers\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/users/1/followers\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/users/1/followers\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/users/1/followers\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f48d076155d0d0050844a","default":"","desc":"Unique user identifier","name":"UserID","required":true,"type":"int"}],"results":{"codes":[{"status":200,"language":"json","code":"[\n    {\n        \"id\":2,\n        \"user_name\":\"Demo1\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo1@m.o\",\n        \"last_login\":\"2015-03-18T11:09:49.4+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-18T11:07:42.3+01:00\",\n        \"updated_at\":\"2015-03-18T11:07:42.3+01:00\"\n    },\n    {\n        \"id\":3,\n        \"user_name\":\"Demo2\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo2@m.o\",\n        \"last_login\":\"2015-03-18T11:06:14.9+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-17T19:38:12.5+01:00\",\n        \"updated_at\":\"2015-03-17T19:38:12.5+01:00\"\n    }\n]","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/users/:UserID/followers"},"body":"","category":"553f839f6a7d010d0057c80c","createdAt":"2015-04-28T09:42:43.939Z","excerpt":"Retrieve followers to display a user who their followers are.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":7,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-followers","sync_unique":"","title":"Retrieve Followers","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Followers

Retrieve followers to display a user who their followers are.

UserID:
required
Integer
Unique user identifier

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":0,"_id":"553f896223c53c0d00cccd1e","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/users/1/friends \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/users/1/friends\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/users/1/friends\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/users/1/friends\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/users/1/followers\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f48d076155d0d0050844a","default":"","desc":"Unique user identifier","name":"UserID","required":true,"type":"int"}],"results":{"codes":[{"status":200,"language":"json","code":"[\n    {\n        \"id\":2,\n        \"user_name\":\"Demo1\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo1@m.o\",\n        \"last_login\":\"2015-03-18T11:09:49.4+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-18T11:07:42.3+01:00\",\n        \"updated_at\":\"2015-03-18T11:07:42.3+01:00\"\n    },\n    {\n        \"id\":3,\n        \"user_name\":\"Demo2\",\n        \"first_name\":\"John\",\n        \"last_name\":\"Smith\",\n        \"email\":\"demo2@m.o\",\n        \"last_login\":\"2015-03-18T11:06:14.9+01:00\",\n        \"enabled\":true,\n        \"created_at\":\"2015-03-17T19:38:12.5+01:00\",\n        \"updated_at\":\"2015-03-17T19:38:12.5+01:00\"\n    }\n]","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/users/:UserID/friends"},"body":"","category":"553f839f6a7d010d0057c80c","createdAt":"2015-04-28T13:21:38.303Z","excerpt":"Retrieve friends of a user.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":8,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-friends","sync_unique":"","title":"Retrieve Friends","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Friends

Retrieve friends of a user.

UserID:
required
Integer
Unique user identifier

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":2,"_id":"553f83a06a7d010d0057c811","api":{"auth":"required","examples":{"codes":[{"name":"","code":"curl https://api.tapglue.com/0.2/user/connections/social \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"platform\":\"facebook\",\"type\":\"friend\",\"platform_user_id\":\"fb-id-1\",\"connection_ids\":[\"fb-id-2\",\"fb-id-4\"]}'","language":"curl"},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"content-type\": @\"application/json\",\n    @\"authorization\": authValue };\nNSDictionary *parameters = @{\n  \t@\"platform\": @\"facebook\",\n    @\"platform_user_id\": @\"fb-id-1\",\n    @\"connection_ids\": @[ @\"fb-id-2\", @\"fb-id-4\" ] };\n\nNSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/connections/social\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"POST\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"content-type\": \"application/json\",\n  \"authorization\": authString\n]\nlet parameters = [\n  \"platform\": \"facebook\",\n  \"platform_user_id\": \"fb-id-1\",\n  \"connection_ids\": [\"fb-id-2\", \"fb-id-4\"]\n]\n\nlet postData = NSJSONSerialization.dataWithJSONObject(parameters, options: nil, error: nil)\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/connections/social\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"platform\\\":\\\"facebook\\\",\\\"platform_user_id\\\":\\\"fb-id-1\\\",\\\"connection_ids\\\":[\\\"fb-id-2\\\",\\\"fb-id-4\\\"]}\");\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/connections/social\")\n  .post(body)\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"content-type\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/connections/social\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{\\\"platform\\\":\\\"facebook\\\",\\\"platform_user_id\\\":\\\"fb-id-1\\\",\\\"connection_ids\\\":[\\\"fb-id-2\\\",\\\"fb-id-4\\\"]}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f48e86a7d010d0057c798","required":true,"desc":"Name of the platform or network","default":"","type":"string","name":"platform"},{"_id":"554243aacbc48d0d00154532","required":true,"desc":"Type of connection","default":"follow, friend","type":"string","name":"type"},{"_id":"553f497b76155d0d0050844d","required":true,"desc":"User identifier of the given platform","default":"","type":"string","name":"platform_user_id"},{"_id":"553f497b76155d0d0050844c","required":true,"desc":"List of connection identifiers","default":"","type":"array_string","name":"connection_ids"}],"results":{"codes":[{"status":201,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/connections/social"},"body":"","category":"553f839f6a7d010d0057c80c","createdAt":"2015-04-27T19:53:15.389Z","excerpt":"Establish connections from a social network like facebook or twitter.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":9,"project":"5538be9dfd56310d00b173d0","slug":"social-connections","sync_unique":"","title":"Social Connections","type":"post","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

postSocial Connections

Establish connections from a social network like facebook or twitter.

platform:
required
String
Name of the platform or network
type:
required
Stringfollow, friend
Type of connection
platform_user_id:
required
String
User identifier of the given platform
connection_ids:
required
Array of Strings
List of connection identifiers

Definition

{{ api_url }}{{ page_api_url }}

Examples

{"__v":3,"_id":"553f83a06a7d010d0057c827","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":""},"body":"Event can be performed on a object with the associated objects id to create more intelligent feeds and deeplink to obects in your application.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"h-3\": \"Required\",\n    \"0-0\": \"`id`\",\n    \"0-1\": \"integer\",\n    \"0-2\": \"Unique user identifier for each event\",\n    \"1-0\": \"`user_id`\",\n    \"1-1\": \"integer\",\n    \"1-2\": \"Unique identifier for user who performed the event\",\n    \"2-0\": \"`verb`\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Verb of the event that was performed (i.e. like or comment)\",\n    \"1-3\": \"✔\",\n    \"2-3\": \"✔\",\n    \"3-0\": \"`language`\",\n    \"3-2\": \"Language of the current user\",\n    \"3-1\": \"string\",\n    \"4-0\": \"`priority`\",\n    \"4-1\": \"string\",\n    \"4-2\": \"Custom priority for the event\",\n    \"5-0\": \"`location`\",\n    \"5-1\": \"string\",\n    \"5-2\": \"Name of the location for an event\",\n    \"6-0\": \"`latitude`\",\n    \"7-0\": \"`longitude`\",\n    \"6-1\": \"float\",\n    \"7-1\": \"float\",\n    \"6-2\": \"Latitude value for a location\",\n    \"7-2\": \"Longitude value for a location\",\n    \"8-0\": \"`metadata`\",\n    \"8-1\": \"string\",\n    \"8-2\": \"Custom payload associated with the event\",\n    \"9-0\": \"`object`\",\n    \"9-1\": \"*Object\",\n    \"9-2\": \"Object the activity was performed on\"\n  },\n  \"cols\": 4,\n  \"rows\": 10\n}\n[/block]\nIf you want to send objects associated with events you need to do it in the following format.\n\n## Object\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"h-3\": \"Required\",\n    \"0-0\": \"`id`\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Unique identifier for each object\",\n    \"0-3\": \"\",\n    \"1-0\": \"`type`\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Type of the object\",\n    \"2-0\": \"`url`\",\n    \"2-1\": \"string\",\n    \"2-2\": \"URL/Deeplink to the object in your application\",\n    \"3-0\": \"`display_name`\",\n    \"3-1\": \"map[string]string\",\n    \"3-2\": \"Object name in different languages\"\n  },\n  \"cols\": 4,\n  \"rows\": 4\n}\n[/block]","category":"553f839f6a7d010d0057c80d","createdAt":"2015-04-23T10:25:28.688Z","excerpt":"Events are the core activity of users in your app, start tracking and use your own network.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"5538be9dfd56310d00b173d0","slug":"events","sync_unique":"","title":"The Event Object","type":"basic","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

The Event Object

Events are the core activity of users in your app, start tracking and use your own network.

Event can be performed on a object with the associated objects id to create more intelligent feeds and deeplink to obects in your application. [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Type", "h-2": "Description", "h-3": "Required", "0-0": "`id`", "0-1": "integer", "0-2": "Unique user identifier for each event", "1-0": "`user_id`", "1-1": "integer", "1-2": "Unique identifier for user who performed the event", "2-0": "`verb`", "2-1": "string", "2-2": "Verb of the event that was performed (i.e. like or comment)", "1-3": "✔", "2-3": "✔", "3-0": "`language`", "3-2": "Language of the current user", "3-1": "string", "4-0": "`priority`", "4-1": "string", "4-2": "Custom priority for the event", "5-0": "`location`", "5-1": "string", "5-2": "Name of the location for an event", "6-0": "`latitude`", "7-0": "`longitude`", "6-1": "float", "7-1": "float", "6-2": "Latitude value for a location", "7-2": "Longitude value for a location", "8-0": "`metadata`", "8-1": "string", "8-2": "Custom payload associated with the event", "9-0": "`object`", "9-1": "*Object", "9-2": "Object the activity was performed on" }, "cols": 4, "rows": 10 } [/block] If you want to send objects associated with events you need to do it in the following format. ## Object [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Type", "h-2": "Description", "h-3": "Required", "0-0": "`id`", "0-1": "string", "0-2": "Unique identifier for each object", "0-3": "", "1-0": "`type`", "1-1": "string", "1-2": "Type of the object", "2-0": "`url`", "2-1": "string", "2-2": "URL/Deeplink to the object in your application", "3-0": "`display_name`", "3-1": "map[string]string", "3-2": "Object name in different languages" }, "cols": 4, "rows": 4 } [/block]
Event can be performed on a object with the associated objects id to create more intelligent feeds and deeplink to obects in your application. [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Type", "h-2": "Description", "h-3": "Required", "0-0": "`id`", "0-1": "integer", "0-2": "Unique user identifier for each event", "1-0": "`user_id`", "1-1": "integer", "1-2": "Unique identifier for user who performed the event", "2-0": "`verb`", "2-1": "string", "2-2": "Verb of the event that was performed (i.e. like or comment)", "1-3": "✔", "2-3": "✔", "3-0": "`language`", "3-2": "Language of the current user", "3-1": "string", "4-0": "`priority`", "4-1": "string", "4-2": "Custom priority for the event", "5-0": "`location`", "5-1": "string", "5-2": "Name of the location for an event", "6-0": "`latitude`", "7-0": "`longitude`", "6-1": "float", "7-1": "float", "6-2": "Latitude value for a location", "7-2": "Longitude value for a location", "8-0": "`metadata`", "8-1": "string", "8-2": "Custom payload associated with the event", "9-0": "`object`", "9-1": "*Object", "9-2": "Object the activity was performed on" }, "cols": 4, "rows": 10 } [/block] If you want to send objects associated with events you need to do it in the following format. ## Object [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Type", "h-2": "Description", "h-3": "Required", "0-0": "`id`", "0-1": "string", "0-2": "Unique identifier for each object", "0-3": "", "1-0": "`type`", "1-1": "string", "1-2": "Type of the object", "2-0": "`url`", "2-1": "string", "2-2": "URL/Deeplink to the object in your application", "3-0": "`display_name`", "3-1": "map[string]string", "3-2": "Object name in different languages" }, "cols": 4, "rows": 4 } [/block]
{"__v":2,"_id":"553f83a06a7d010d0057c813","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/events \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H 'Accept: application/json' \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H \"Content-Type: application/json\" \\\n    -d '{ \"verb\":\"like\",\n    \t\t\t\"object\":{\n        \t\t\t\"id\":\"picture1\",\n        \t\t\t\"type\":\"picture\",\n        \t\t\t\"display_name\":{\n            \t\t\t\"en\":\"Picture 1\",\n            \t\t\t\"de\":\"Bild 1\"\n        \t\t\t}\n    \t\t\t},\n    \t\t\t\"metadata\":{\n        \t\t\t\"category\":\"landscape\"\n    \t\t\t}\n\t\t\t}'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"content-type\": @\"application/json\",\n    @\"authorization\": authValue };\nNSDictionary *parameters = @{\n  \t@\"verb\": @\"like\",\n    @\"object\": @{\n    \t\t@\"id\": @\"picture1\",\n      \t@\"type\": @\"picture\",\n      \t@\"display_name\": @{\n        \t\t@\"en\": @\"Picture 1\",\n          \t@\"de\": @\"Bild 1\" }},\n    @\"metadata\": @{\n    \t\t@\"category\": @\"landscape\" }};\n\nNSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/events\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"POST\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"content-type\": \"application/json\",\n  \"authorization\": authString\n]\nlet parameters = [\n  \"verb\": \"like\",\n  \"object\": [\n    \"id\": \"picture1\",\n    \"type\": \"picture\",\n    \"display_name\": [\n      \"en\": \"Picture 1\",\n      \"de\": \"Bild 1\"\n    ]\n  ],\n  \"metadata\": [\"category\": \"landscape\"]\n]\n\nlet postData = NSJSONSerialization.dataWithJSONObject(parameters, options: nil, error: nil)\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/events\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"verb\\\":\\\"like\\\",\\\"object\\\":{\\\"id\\\":\\\"picture1\\\",\\\"type\\\":\\\"picture\\\",\\\"display_name\\\":{\\\"en\\\":\\\"Picture 1\\\",\\\"de\\\":\\\"Bild 1\\\"}},\\\"metadata\\\":{\\\"category\\\":\\\"landscape\\\"}}\");\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/events\")\n  .post(body)\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"content-type\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/events\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{\\\"verb\\\":\\\"like\\\",\\\"object\\\":{\\\"id\\\":\\\"picture1\\\",\\\"type\\\":\\\"picture\\\",\\\"display_name\\\":{\\\"en\\\":\\\"Picture 1\\\",\\\"de\\\":\\\"Bild 1\\\"}},\\\"metadata\\\":{\\\"category\\\":\\\"landscape\\\"}}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f4a6423c53c0d00cccc7b","required":true,"desc":"Name of the activity that was performed","default":"","type":"string","name":"verb"},{"_id":"553f4a6423c53c0d00cccc7a","required":false,"desc":"Language of the current user","default":"","type":"string","name":"language"},{"_id":"553f4a6423c53c0d00cccc79","required":false,"desc":"Custom priority for the activity","default":"","type":"string","name":"priority"},{"_id":"553f4a6423c53c0d00cccc78","required":false,"desc":"Name of the location for an activity","default":"","type":"string","name":"location"},{"_id":"553f4a6423c53c0d00cccc77","required":false,"desc":"Latitude value for a locaton","default":"","type":"double","name":"latitude"},{"_id":"553f4a6423c53c0d00cccc76","required":false,"desc":"Longitude value for a location","default":"","type":"double","name":"longitude"},{"_id":"553f4a6423c53c0d00cccc75","required":false,"desc":"Custom payload associated with the activity","default":"","type":"object","name":"metadata"},{"_id":"553f4a6423c53c0d00cccc74","required":false,"desc":"Object the activity was performed on","default":"","type":"object","name":"object"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"id\":1,\n    \"user_id\":1,\n    \"verb\":\"like\",\n    \"object\":{\n        \"id\":\"picture1\",\n        \"type\":\"picture\",\n        \"display_name\":{\n            \"de\":\"Bild 1\",\n            \"en\":\"Picture 1\"\n        }\n    },\n    \"metadata\":{\n        \"category\":\"landscape\"\n    },\n    \"enabled\":true,\n    \"created_at\":\"2015-03-21T14:28:02.4+01:00\",\n    \"updated_at\":\"2015-03-21T14:28:02.4+01:00\"\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/users/events"},"body":"Objects can be sent in the following format.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"h-3\": \"Required\",\n    \"0-3\": \"✔\",\n    \"0-0\": \"`id`\",\n    \"1-0\": \"`type`\",\n    \"2-0\": \"`url`\",\n    \"3-0\": \"`display_name`\",\n    \"0-1\": \"string\",\n    \"1-1\": \"string\",\n    \"2-1\": \"string\",\n    \"3-1\": \"map[string]string\",\n    \"0-2\": \"Unique identifier for each object\",\n    \"1-2\": \"Type of the object\",\n    \"2-2\": \"URL/Deeplink to the object in your application\",\n    \"3-2\": \"Object name in different languages\"\n  },\n  \"cols\": 4,\n  \"rows\": 4\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Core Events\",\n  \"body\": \"Keep in mind that all events your are tracking will be present in the news feed of friends or followers. We recommend you to track your core events in your app and not send something like a screen view or app start.\"\n}\n[/block]","category":"553f839f6a7d010d0057c80d","createdAt":"2015-04-27T19:55:35.177Z","excerpt":"Create an event when a user performs a core activity in your app.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"project":"5538be9dfd56310d00b173d0","slug":"create-event","sync_unique":"","title":"Create Event","type":"post","updates":["55489ae9afc5ed0d00e1453e"],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

postCreate Event

Create an event when a user performs a core activity in your app.

verb:
required
String
Name of the activity that was performed
language:
String
Language of the current user
priority:
String
Custom priority for the activity
location:
String
Name of the location for an activity
latitude:
Double
Latitude value for a locaton
longitude:
Double
Longitude value for a location
metadata:
Object
Custom payload associated with the activity
object:
Object
Object the activity was performed on
Objects can be sent in the following format. [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Type", "h-2": "Description", "h-3": "Required", "0-3": "✔", "0-0": "`id`", "1-0": "`type`", "2-0": "`url`", "3-0": "`display_name`", "0-1": "string", "1-1": "string", "2-1": "string", "3-1": "map[string]string", "0-2": "Unique identifier for each object", "1-2": "Type of the object", "2-2": "URL/Deeplink to the object in your application", "3-2": "Object name in different languages" }, "cols": 4, "rows": 4 } [/block] [block:callout] { "type": "info", "title": "Core Events", "body": "Keep in mind that all events your are tracking will be present in the news feed of friends or followers. We recommend you to track your core events in your app and not send something like a screen view or app start." } [/block]
Objects can be sent in the following format. [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Type", "h-2": "Description", "h-3": "Required", "0-3": "✔", "0-0": "`id`", "1-0": "`type`", "2-0": "`url`", "3-0": "`display_name`", "0-1": "string", "1-1": "string", "2-1": "string", "3-1": "map[string]string", "0-2": "Unique identifier for each object", "1-2": "Type of the object", "2-2": "URL/Deeplink to the object in your application", "3-2": "Object name in different languages" }, "cols": 4, "rows": 4 } [/block] [block:callout] { "type": "info", "title": "Core Events", "body": "Keep in mind that all events your are tracking will be present in the news feed of friends or followers. We recommend you to track your core events in your app and not send something like a screen view or app start." } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":1,"_id":"553f83a06a7d010d0057c814","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/events/1 \\\n    -X PUT \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json' \\\n    -H \"Content-Type: application/json\" \\\n    -d '{ \"verb\":\"like\",\n    \t\t\t\"object\":{\n        \t\t\t\"id\":\"picture1\",\n        \t\t\t\"type\":\"picture\",\n        \t\t\t\"display_name\":{\n            \t\t\t\"en\":\"Picture 1\",\n            \t\t\t\"de\":\"Bild 1\"\n        \t\t\t}\n    \t\t\t},\n    \t\t\t\"metadata\":{\n        \t\t\t\"category\":\"landscape\"\n    \t\t\t}\n\t\t\t}'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"content-type\": @\"application/json\",\n    @\"authorization\": authValue };\nNSDictionary *parameters = @{\n  \t@\"verb\": @\"like\",\n    @\"object\": @{\n    \t\t@\"id\": @\"picture1\",\n      \t@\"type\": @\"picture\",\n      \t@\"display_name\": @{\n        \t\t@\"en\": @\"Picture 1\",\n          \t@\"de\": @\"Bild 1\" }},\n    @\"metadata\": @{\n    \t\t@\"category\": @\"landscape\" }};\n\nNSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/events/1\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"PUT\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"content-type\": \"application/json\",\n  \"authorization\": authString\n]\nlet parameters = [\n  \"verb\": \"like\",\n  \"object\": [\n    \"id\": \"picture1\",\n    \"type\": \"picture\",\n    \"display_name\": [\n      \"en\": \"Picture 1\",\n      \"de\": \"Bild 1\"\n    ]\n  ],\n  \"metadata\": [\"category\": \"landscape\"]\n]\n\nlet postData = NSJSONSerialization.dataWithJSONObject(parameters, options: nil, error: nil)\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/events/1\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"PUT\"\nrequest.allHTTPHeaderFields = headers\nrequest.HTTPBody = postData\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"verb\\\":\\\"like\\\",\\\"object\\\":{\\\"id\\\":\\\"picture1\\\",\\\"type\\\":\\\"picture\\\",\\\"display_name\\\":{\\\"en\\\":\\\"Picture 1\\\",\\\"de\\\":\\\"Bild 1\\\"}},\\\"metadata\\\":{\\\"category\\\":\\\"landscape\\\"}}\");\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/events/1\")\n  .put(body)\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"content-type\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/events/1\");\nvar request = new RestRequest(Method.PUT);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{\\\"verb\\\":\\\"like\\\",\\\"object\\\":{\\\"id\\\":\\\"picture1\\\",\\\"type\\\":\\\"picture\\\",\\\"display_name\\\":{\\\"en\\\":\\\"Picture 1\\\",\\\"de\\\":\\\"Bild 1\\\"}},\\\"metadata\\\":{\\\"category\\\":\\\"landscape\\\"}}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f4cb876155d0d00508465","required":true,"desc":"Unique event identifier","default":"URI Parameter","type":"string","name":"ID"},{"_id":"553f4cb876155d0d00508464","required":false,"desc":"Name of the activity that was performed","default":"","type":"string","name":"verb"},{"_id":"553f4cb876155d0d00508463","required":false,"desc":"Language of the current user","default":"","type":"string","name":"language"},{"_id":"553f4cb876155d0d00508462","required":false,"desc":"Custom priority for the activity","default":"","type":"string","name":"priority"},{"_id":"553f4cb876155d0d00508461","required":false,"desc":"Name of the location for an activity","default":"","type":"string","name":"location"},{"_id":"553f4cb876155d0d00508460","required":false,"desc":"Latitude value for a locaton","default":"","type":"double","name":"latitude"},{"_id":"553f4cb876155d0d0050845f","required":false,"desc":"Longitude value for a location","default":"","type":"double","name":"longitude"},{"_id":"553f4cb876155d0d0050845e","required":false,"desc":"Custom payload associated with the activity","default":"","type":"object","name":"metadata"},{"_id":"553f4cb876155d0d0050845d","required":false,"desc":"Object the activity was performed on","default":"","type":"object","name":"object"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"id\":1,\n    \"user_id\":1,\n    \"verb\":\"like\",\n    \"object\":{\n        \"id\":\"picture1\",\n        \"type\":\"picture\",\n        \"display_name\":{\n            \"de\":\"Bild 1\",\n            \"en\":\"Picture 1\"\n        }\n    },\n    \"metadata\":{\n        \"category\":\"landscape\"\n    },\n    \"enabled\":true,\n    \"created_at\":\"2015-03-21T14:28:02.4+01:00\",\n    \"updated_at\":\"2015-03-21T14:28:02.4+01:00\"\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/events/:EventID"},"body":"","category":"553f839f6a7d010d0057c80d","createdAt":"2015-04-27T19:57:12.875Z","excerpt":"Update an event if an attribute in the performed activity changes.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"project":"5538be9dfd56310d00b173d0","slug":"update-event","sync_unique":"","title":"Update Event","type":"put","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

putUpdate Event

Update an event if an attribute in the performed activity changes.

ID:
required
StringURI Parameter
Unique event identifier
verb:
String
Name of the activity that was performed
language:
String
Language of the current user
priority:
String
Custom priority for the activity
location:
String
Name of the location for an activity
latitude:
Double
Latitude value for a locaton
longitude:
Double
Longitude value for a location
metadata:
Object
Custom payload associated with the activity
object:
Object
Object the activity was performed on

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":1,"_id":"553f83a06a7d010d0057c815","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/events/1 \\\n    -X DELETE \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/events/1\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"DELETE\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/events/1\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"DELETE\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/events/1\")\n  .delete(null)\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/events/1\");\nvar request = new RestRequest(Method.DELETE);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f4d366a7d010d0057c7aa","required":true,"desc":"Unique event identifier","default":"URI Parameter","type":"string","name":"EventID"}],"results":{"codes":[{"status":204,"language":"json","code":"","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/events/:EventID"},"body":"","category":"553f839f6a7d010d0057c80d","createdAt":"2015-04-27T20:00:21.279Z","excerpt":"Delete an event if a user undos an activity (i.e. unlike).","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"project":"5538be9dfd56310d00b173d0","slug":"delete-event","sync_unique":"","title":"Delete Event","type":"delete","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

deleteDelete Event

Delete an event if a user undos an activity (i.e. unlike).

EventID:
required
StringURI Parameter
Unique event identifier

Definition

{{ api_url }}{{ page_api_url }}

Examples

{"__v":0,"_id":"554745366184460d006fd894","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/events/1 \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/events/1\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/events/1\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/events/1\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/events/1\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"554745366184460d006fd895","required":false,"desc":"Unique event identifier","default":"URI Parameter","type":"string","name":"EventID"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"id\":1,\n    \"user_id\":1,\n    \"verb\":\"like\",\n    \"object\":{\n        \"id\":\"picture1\",\n        \"type\":\"picture\",\n        \"display_name\":{\n            \"de\":\"Bild 1\",\n            \"en\":\"Picture 1\"\n        }\n    },\n    \"metadata\":{\n        \"category\":\"landscape\"\n    },\n    \"enabled\":true,\n    \"created_at\":\"2015-03-21T14:28:02.4+01:00\",\n    \"updated_at\":\"2015-03-21T14:28:02.4+01:00\"\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/events/:EventID"},"body":"","category":"553f839f6a7d010d0057c80d","createdAt":"2015-05-04T10:08:54.966Z","excerpt":"Retrieve a single event of the current user to show all it's details.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":4,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-current-user-event","sync_unique":"","title":"Retrieve Current User Event","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Current User Event

Retrieve a single event of the current user to show all it's details.

EventID:
StringURI Parameter
Unique event identifier

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":0,"_id":"553f83a06a7d010d0057c816","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/users/1/events/1 \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/users/1/events/1\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/users/1/events/1\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/users/1/events/1\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/users/1/events/1\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f4d9d76155d0d0050846b","required":true,"desc":"Unique user identifier","default":"URI Parameter","type":"int","name":"UserID"},{"_id":"553f4d9d76155d0d0050846a","default":"URI Parameter","desc":"Unique event identifier","name":"EventID","required":true,"type":"string"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"id\":1,\n    \"user_id\":1,\n    \"verb\":\"like\",\n    \"object\":{\n        \"id\":\"picture1\",\n        \"type\":\"picture\",\n        \"display_name\":{\n            \"de\":\"Bild 1\",\n            \"en\":\"Picture 1\"\n        }\n    },\n    \"metadata\":{\n        \"category\":\"landscape\"\n    },\n    \"enabled\":true,\n    \"created_at\":\"2015-03-21T14:28:02.4+01:00\",\n    \"updated_at\":\"2015-03-21T14:28:02.4+01:00\"\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/users/:UserID/events/:EventID"},"body":"","category":"553f839f6a7d010d0057c80d","createdAt":"2015-04-27T20:00:54.164Z","excerpt":"Retrieve a single event to show all it's details.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":5,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-event","sync_unique":"","title":"Retrieve Event","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Event

Retrieve a single event to show all it's details.

UserID:
required
IntegerURI Parameter
Unique user identifier
EventID:
required
StringURI Parameter
Unique event identifier

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":6,"_id":"554745e39a48800d00c6e473","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/events \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/events\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/events\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/events\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/events\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"[\n    {\n        \"id\":3,\n        \"user_id\":1,\n        \"verb\":\"like\",\n        \"object\":{\n            \"id\":\"picture3\",\n            \"type\":\"picture\",\n            \"display_name\":{\n                \"de\":\"Bild3\",\n                \"en\":\"Picture3\"\n            }\n        },\n        \"metadata\":{\n            \"category\":\"landscape\"\n        },\n        \"enabled\":true,\n        \"created_at\":\"2015-03-21T15:56:17.4+01:00\",\n        \"updated_at\":\"2015-03-21T15:56:17.4+01:00\"\n    },\n    {\n        \"id\":2,\n        \"user_id\":1,\n        \"verb\":\"like\",\n        \"object\":{\n            \"id\":\"picture2\",\n            \"type\":\"picture\",\n            \"display_name\":{\n                \"de\":\"Bild2\",\n                \"en\":\"Picture2\"\n            }\n        },\n        \"metadata\":{\n            \"category\":\"landscape\"\n        },\n        \"enabled\":true,\n        \"created_at\":\"2015-03-21T15:56:15.8+01:00\",\n        \"updated_at\":\"2015-03-21T15:56:15.8+01:00\"\n    }\n]","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/events"},"body":"","category":"553f839f6a7d010d0057c80d","createdAt":"2015-05-04T10:11:47.542Z","excerpt":"Retrieve the current users events to display their activity under their profile for example.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":6,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-current-user-events","sync_unique":"","title":"Retrieve Current User Events","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Current User Events

Retrieve the current users events to display their activity under their profile for example.

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":0,"_id":"553f83a06a7d010d0057c817","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/users/1/events \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/users/1/events\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/users/1/events\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/users/1/events\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/users/1/events\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[{"_id":"553f4db976155d0d0050846c","default":"URI Parameter","desc":"Unique event identifier","name":"UserID","required":true,"type":"int"}],"results":{"codes":[{"name":"","code":"[\n    {\n        \"id\":3,\n        \"user_id\":1,\n        \"verb\":\"like\",\n        \"object\":{\n            \"id\":\"picture3\",\n            \"type\":\"picture\",\n            \"display_name\":{\n                \"de\":\"Bild3\",\n                \"en\":\"Picture3\"\n            }\n        },\n        \"metadata\":{\n            \"category\":\"landscape\"\n        },\n        \"enabled\":true,\n        \"created_at\":\"2015-03-21T15:56:17.4+01:00\",\n        \"updated_at\":\"2015-03-21T15:56:17.4+01:00\"\n    },\n    {\n        \"id\":2,\n        \"user_id\":1,\n        \"verb\":\"like\",\n        \"object\":{\n            \"id\":\"picture2\",\n            \"type\":\"picture\",\n            \"display_name\":{\n                \"de\":\"Bild2\",\n                \"en\":\"Picture2\"\n            }\n        },\n        \"metadata\":{\n            \"category\":\"landscape\"\n        },\n        \"enabled\":true,\n        \"created_at\":\"2015-03-21T15:56:15.8+01:00\",\n        \"updated_at\":\"2015-03-21T15:56:15.8+01:00\"\n    }\n]","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"url":"/users/:UserID/events"},"body":"","category":"553f839f6a7d010d0057c80d","createdAt":"2015-04-27T20:03:11.058Z","excerpt":"Retrieve a users events to display their activity under their profile for example.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":7,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-user-events","sync_unique":"","title":"Retrieve User Events","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve User Events

Retrieve a users events to display their activity under their profile for example.

UserID:
required
IntegerURI Parameter
Unique event identifier

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":9,"_id":"553f83a06a7d010d0057c818","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/feed \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""},{"language":"objectivec","code":"#import <Foundation/Foundation.h>\n\nNSString *authStr = [NSString stringWithFormat:@\"%@:%@\", @\"APP_TOKEN\", @\"SESSION_TOKEN\"];\n    NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding];\n    NSString *base64authData = [authData base64EncodedStringWithOptions:0];\n    NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", base64authData];\n    \nNSDictionary *headers = @{\n    @\"accept\": @\"application/json\",\n    @\"authorization\": authValue };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@/api.tapglue.com/0.2/user/feed\"]\n                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy\ntimeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n\t\tcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n    \t\tif (error) {\n        \t\tNSLog(@\"%@\", error);\n        } else {\n            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n            \t\tNSLog(@\"%@\", httpResponse);}\n        }];\n\n[dataTask resume];"},{"name":"Swift","language":"objectivec","code":"import Foundation\n\nlet basicAuthString = \"APP_TOKEN\" + \":\" + \"SESSION_TOKEN\"\nlet basicAuthData = basicAuthString.dataUsingEncoding(NSUTF8StringEncoding)\nlet base64EncodedCredential = basicAuthData!.base64EncodedStringWithOptions(nil)\nlet authString = \"Basic \\(base64EncodedCredential)\"\n  \nlet headers = [\n  \"accept\": \"application/json\",\n  \"authorization\": authString\n]\n\nvar request = NSMutableURLRequest(URL: NSURL(string: /api.tapglue.com/0.2/user/feed\")!,\n\t\tcachePolicy: .UseProtocolCachePolicy,\n    timeoutInterval: 10.0)\n\nrequest.HTTPMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = NSURLSession.sharedSession()\nlet dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in\n  if (error != nil) {\n    println(error)\n  } else {\n    let httpResponse = response as? NSHTTPURLResponse\n    println(httpResponse)\n  }\n})\n\ndataTask.resume()"},{"language":"java","code":"OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n  .url(/api.tapglue.com/0.2/user/feed\")\n  .get()\n  .addHeader(\"accept\", \"application/json\")\n  .addHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\")\n  .build();\n\nResponse response = client.newCall(request)cute();"},{"language":"csharp","code":"var client = new RestClient(/api.tapglue.com/0.2/user/feed\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"authorization\", \"Basic APP_TOKEN:SESSION_TOKEN\");\nrequest.AddHeader(\"accept\", \"application/json\");\nIRestResponse response = client.Execute(request);"}]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\n   \"unread_events_count\":0,\n   \"events\":[\n      {\n         \"id\":\"3960c420-3fdf-5f2d-a559-bd0873f56894\",\n         \"user_id\":\"8911b06c-b745-53ee-bf7b-b9053d8224bf\",\n         \"verb\":\"like\",\n         \"language\":\"en\",\n         \"location\":\"location-10\",\n         \"latitude\":52.5157576,\n         \"longitude\":13.3873319,\n         \"object\":{\n            \"id\":\"object-10\",\n            \"type\":\"\",\n            \"display_name\":{\n               \"all\":\"object-10-lall\"\n            }\n         },\n         \"target\":{\n            \"id\":\"target-10\",\n            \"type\":\"\",\n            \"display_name\":{\n               \"all\":\"target-10-lall\"\n            }\n         },\n         \"metadata\":{\n            \"more\":\"data\"\n         },\n         \"created_at\":\"2015-05-18T10:26:14.93+02:00\",\n         \"updated_at\":\"2015-05-18T10:26:14.39+02:00\",\n         \"enabled\":true\n      },\n      {\n         \"id\":\"731748e2-67a2-57f3-844d-a21f3bdb47d3\",\n         \"user_id\":\"8911b06c-b745-53ee-bf7b-b9053d8224bf\",\n         \"verb\":\"like\",\n         \"language\":\"en\",\n         \"location\":\"location-9\",\n         \"latitude\":52.5157576,\n         \"longitude\":13.3873319,\n         \"object\":{\n            \"id\":\"object-9\",\n            \"type\":\"\",\n            \"display_name\":{\n               \"all\":\"object-9-lall\"\n            }\n         },\n         \"target\":{\n            \"id\":\"target-9\",\n            \"type\":\"\",\n            \"display_name\":{\n               \"all\":\"target-9-lall\"\n            }\n         },\n         \"metadata\":{\n            \"more\":\"data\"\n         },\n         \"created_at\":\"2015-05-18T10:26:14.33+02:00\",\n         \"updated_at\":\"2015-05-18T10:26:14.83+02:00\",\n         \"enabled\":true\n      }\n   ]\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/feed"},"body":"","category":"553f839f6a7d010d0057c80d","createdAt":"2015-04-27T20:04:26.452Z","excerpt":"Retrieve the feed and show the users the activity of their followers or friends.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":8,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-feed","sync_unique":"","title":"Retrieve Feed","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Feed

Retrieve the feed and show the users the activity of their followers or friends.

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":4,"_id":"5559bde8c9cbc70d003db247","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl https://api.tapglue.com/0.2/user/feed/unread \\\n    -u APP_TOKEN:SESSION_TOKEN \\\n    -H \"User-Agent: Tapglue Test UA\" \\\n    -H 'Accept: application/json'","name":""}]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\n   \"unread_events_count\":2,\n   \"events\":[\n      {\n         \"id\":\"3960c420-3fdf-5f2d-a559-bd0873f56894\",\n         \"user_id\":\"8911b06c-b745-53ee-bf7b-b9053d8224bf\",\n         \"verb\":\"like\",\n         \"language\":\"en\",\n         \"location\":\"location-10\",\n         \"latitude\":52.5157576,\n         \"longitude\":13.3873319,\n         \"object\":{\n            \"id\":\"object-10\",\n            \"type\":\"\",\n            \"display_name\":{\n               \"all\":\"object-10-lall\"\n            }\n         },\n         \"target\":{\n            \"id\":\"target-10\",\n            \"type\":\"\",\n            \"display_name\":{\n               \"all\":\"target-10-lall\"\n            }\n         },\n         \"metadata\":{\n            \"more\":\"data\"\n         },\n         \"created_at\":\"2015-05-18T10:26:14.89+02:00\",\n         \"updated_at\":\"2015-05-18T10:26:14.83+02:00\",\n         \"enabled\":true\n      },\n      {\n         \"id\":\"731748e2-67a2-57f3-844d-a21f3bdb47d3\",\n         \"user_id\":\"8911b06c-b745-53ee-bf7b-b9053d8224bf\",\n         \"verb\":\"like\",\n         \"language\":\"en\",\n         \"object\":{\n            \"id\":\"object-9\",\n            \"type\":\"\",\n            \"display_name\":{\n               \"all\":\"object-9-lall\"\n            }\n         },\n         \"metadata\":{\n            \"more\":\"data\"\n         },\n         \"created_at\":\"2015-05-18T10:26:14.83+02:00\",\n         \"updated_at\":\"2015-05-18T10:26:14.83+02:00\",\n         \"enabled\":true\n      }\n   ]\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/feed/unread"},"body":"","category":"553f839f6a7d010d0057c80d","createdAt":"2015-05-18T10:24:40.397Z","excerpt":"Retrieve the feed of unread events of a user.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":999,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-unread-events","sync_unique":"","title":"Retrieve Unread Feed","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Unread Feed

Retrieve the feed of unread events of a user.

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

{"__v":3,"_id":"5559beb507b1710d0055fa47","api":{"auth":"required","examples":{"codes":[{"name":"","code":"curl https://api.tapglue.com/0.2/user/feed/unread/count \\\n-u APP_TOKEN:SESSION_TOKEN \\\n-H \"User-Agent: Tapglue Test UA\" \\\n-H 'Accept: application/json'","language":"curl"}]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\n   \"unread_events_count\":30\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"url":"/user/feed/unread/count"},"body":"","category":"553f839f6a7d010d0057c80d","createdAt":"2015-05-18T10:28:05.396Z","excerpt":"Retrieve the count of unread events of a user.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":999,"project":"5538be9dfd56310d00b173d0","slug":"retrieve-unread-feed-count","sync_unique":"","title":"Retrieve Unread Count","type":"get","updates":[],"user":"5538be74fd56310d00b173cf","version":"553f839e6a7d010d0057c808"}

getRetrieve Unread Count

Retrieve the count of unread events of a user.

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format