{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"ed097781-c275-6f7c-385f-a90b65dbc86f","name":"CocoaHeads Server","description":"This is server side API for CocoaHeads Russia app.\n\n# Overview\nAPI consist of 2 main parts: \n- In *Users* and *Creators* folders you can find methods to create, update and receive app users and get list of app creators;\n- In *Events* and *Speeches* folders — methods to get events list, certain event by ID, event speeches, register to event and get speech info.\n\n# Authentication\nEach request contains `app-token` header, which is simple `test` string for development and staging environment.\n\n## User Auth\nUser for CH App must be created only by `user/auth` end point by `POST`-method.  This endpoint expect from CH App:\nClient-token in HTTP `headers` (needs for any request)\n```swift\nappHeaders[\"client-token\"] = \"sdfsfr2398u98dshsdnfs9h2893hr2\"\n```\nwhere the `token` is a secret token for the CH App identified \n\nand `body` as JSON like this \n```json \n{\n\"token\": \"dfs232rfsefsf2r23fdsfs\",\n\"social\": \"facebook\",\n\"secret\": \"sdfsdfsdfsd\"\n}\n```\nwhere:\n**for all:**\n- `social` - may be only one of  `\"facebook\"`, `\"vkontakte\"`, `\"github\"` (see `Social+Net.swift`)\n\n**for Facebook:**\n- `token` - token received from Facebook one-used code, not saved, used only for auth and get user profile (name, photo)\n- `secret` - not used \n\n**for VKontakte:**\n- `token` -  access _token received from VK for persistent request to network - not saved, used only for auth and  user profile (name, photo) request\n- `secret` - received from VK \n\n**for Github:**\n- `token` -  access_token received from VK for persistent request to network - not saved, used only for auth and  user profile (name, photo) request\n- `secret` - secret is CH App's a random generated seed used when App's User pass thought GIT-authorization. Need to prevent the  Man-In-the-middle attack \n\nResponse from server example: \n```JSON\n{\n  \"position\" : null,\n  \"name\" : \"Cocoaheads\",\n  \"email\" : null,\n  \"id\" : 1,\n  \"lastname\" : \"Developer\",\n  \"token\" : \"Xuq5dHHyv0kr1g+jiSitQQ==\",\n  \"photo\" : \"http://dev.cocoaheads.ru:8080/user_photos/1/WldP9iZxtIg.jpg\",\n  \"phone\" : null,\n  \"company\" : null\n}\n```\nwhere `token` need use for all request to auth-zone (see middleware section). \nBE ATTENTION: `AuthMiddleware` expected a token in header  only in such view:\n```swift\n\"Authorization\" : \"Bearer Xuq5dHHyv0kr1g+jiSitQQ==\" \n```\nwere `Authorization` is header key, and  **`Bearer `** (with trailing whitespace) special word used by `AuthMiddleware` for define auth type. Also there are `basic`- password\\login and `session` by cookies types. **So don't forget add  `Bearer ` to header**\n\n## Routing \n\nThere are three access level:  with no have authentication, with only CH App's  token and at least Bearer token (see above User auth section). \n\n1. without auth: only  `heartbeat` to test server alive \n2. with app-token: `event`, `event/:id/speech`, `user/auth`\n3. with user or bearer token: `event/:id/form`, `event/register`, `user`\n\n\n# Error Codes\n- 400 - *Bad Request*, wrong header, not enough params, bad JSON body etc\n- 401 - *Unauthorized*, bad client-token and or user-auth (see auth section)\n- 404 - *Not Found* - only if wrong endpoint path\n- 500 - *Internal Server Error* - any internal problem including case not found objec into Database \n\n\n# GutHub\n[Server Application](https://github.com/cocoaheadsru/server) | [Client iOS Application](https://github.com/cocoaheadsru/application)","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"2940498","team":2089034,"collectionId":"ed097781-c275-6f7c-385f-a90b65dbc86f","publishedId":"7EEfDcy","public":true,"publicUrl":"https://documenter-api.postman.tech/view/2940498/7EEfDcy","privateUrl":"https://go.postman.co/documentation/2940498-ed097781-c275-6f7c-385f-a90b65dbc86f","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","version":"8.11.9","publishDate":"2018-03-04T14:24:54.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"stage.template","id":"141e0472-9384-175f-0b4f-6b43cc717276","owner":"2940498","values":[{"enabled":true,"key":"domain","value":"http://dev.cocoaheads.ru","type":"text"},{"enabled":true,"key":"client-token","value":"test","type":"text"}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/7ac3e805c5632d6852e8338357722d92c8c22db9cb92b125e824c8bc951bb57d","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"stage.template","value":"2940498-141e0472-9384-175f-0b4f-6b43cc717276"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/7EEfDcy"}