======= æ¦‚è¦ ======= http://developer.foursquare.com/docs/overview.html .. The foursquare API uses many of the same standards as other APIs you may be familiar with. All requests are simple GET or POST requests that return JSON or JSONP respones. (Note that the request parameters are not JSON, they are standard HTTP keys and values.) All authentication is via OAuth2, which means that all requests MUST be https. The foursquare API ã¯ã‚ãªãŸãŒæ…£ã‚Œè¦ªã—ã‚“ã§ã„ã‚‹ã§ã‚ã‚ã†ä»–ã®APIã¨åŒæ§˜ã«ã€ 多ãã®Web標準を使用ã—ã¦ã„ã¾ã™ã€‚å…¨ã¦ã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã¯JSONã‹JSONPã‚’è¿”ã™å˜ç´” ãªGETã‹POSTリクエストã§ã™ã€‚ (リクエストã®ãƒ‘ラメータã¯JSONã§ã¯ãªãã€æ¨™æº– çš„ãªHTTPã®ã‚ーãƒãƒªãƒ¥ãƒ¼ã§ã‚ã‚‹ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„) å…¨ã¦ã®èªè¨¼ã¯OAuth2 ã§è¡Œã‚れã€ãれã¯ã™ãªã‚ã¡ã€å…¨ã¦ã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã¯httpsã§ãªã‘れ㰠*ãªã‚‰ãªã„* ã¨ã„ã†ã“ã¨ã§ã™ã€‚ ------------------- APIã®åˆ©ç”¨å›žæ•°åˆ¶é™ ------------------- .. Usage of the API is subject to rate limits. The limits are based on a moving window that tracks the number of requests you send per hour. APIã®åˆ©ç”¨å›žæ•°ã¯åˆ¶é™ã•れã¾ã™ã€‚ã“ã®åˆ¶é™ã¯ä¸€æ™‚間毎ã«é€ã‚‰ã‚Œã‚‹ãƒªã‚¯ã‚¨ã‚¹ãƒˆã®æ•° を追跡ã—ã€éšæ™‚å¤‰æ›´ã•れã¾ã™ã€‚ .. The default limit is 200 requests per hour per method. The rate limiting is applied to the OAuth user or, if none is present, the IP address. 最åˆã®åˆ¶é™ã¯ãƒ¡ã‚½ãƒƒãƒ‰æ¯Žã«ä¸€æ™‚é–“ã«200リクエストã§ã™ã€‚ã“ã®åˆ¶é™ã¯OAuthユー ã‚¶ã‹ã€ãã†ã§ãªã‘れã°IPアドレス毎ã«ã‹ã‹ã‚Šã¾ã™ã€‚ .. Your application should try to play nicely against our methods. For instance, cache results on your side wherever possible (e.g., /venue calls usually tend to be more long-lived than others). ã‚ãªãŸã®ã‚¢ãƒ—リケーションã¯foursquareã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’優ã—ãæ‰±ã‚ãªã‘れã°ãªã‚Š ã¾ã›ã‚“。具体的ã«ã¯ã€ã‚¢ãƒ—リケーションå´ã§å¯èƒ½ãªã‹ãŽã‚Šã‚ャッシュã™ã‚‹ã“㨠ã§ã™ã€‚ (例: /venue ã¯ä»–ã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æ¯”ã¹ã¦é€šå¸¸é•·ã„期間有効ã§ã™) .. We're still learning about your apps and tweaking these caps. If your application runs into any of our bounds and you think you could use more, write us at api@foursquare.com with your client id and IP addresses. ç§ãŸã¡ã¯ã‚ãªãŸã®ã‚¢ãƒ—リケーションã«ã¤ã„ã¦èª¿æŸ»ã—ã¦ã„ã¾ã™ã€‚ã‚‚ã—ã€ã‚ãªãŸã® アプリケーションãŒç§ãŸã¡ã®åˆ¶é™ã«ã‚ãŸã‚Šã€ã‚ãªãŸãŒã‚‚ã£ã¨ä½¿ã„ãŸã„ã¨æ€ã†å ´ åˆã«ã¯ã€ api@foursquare.com ã«ã‚ãªãŸã®ã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆ IDã¨IPアドレスã¨ã¨ã¨ ã‚‚ã«é€£çµ¡ã—ã¦ãã ã•ã„。 --------------- レスãƒãƒ³ã‚¹ --------------- å…¨ã¦ã®ãƒ¬ã‚¹ãƒãƒ³ã‚¹ã¯ä»¥ä¸‹ã®ã‚ˆã†ãªå½¢å¼ã§è¿”ã•れã¾ã™ã€‚:: { "meta": { "code": 200, ...errorType and errorDetail... }, "notifications": { ...notifications... }, "response": { ...results... } } .. The errorType is detailed information intended for the application developer. We ask applications to show an appropriate error to their users by handling the error codes listed below. We will add additional types as needed. The deprecated type may be returned even if a request is successful. `errorType` ã¯ã‚¢ãƒ—リケーション開発者ã«ã¨ã£ã¦è©³ç´°ãªæƒ…å ±ã‚’æä¾›ã—ã¾ã™ã€‚ç§ ãŸã¡ã¯å¾Œè¿°ã™ã‚‹ã‚¨ãƒ©ãƒ¼ã‚³ãƒ¼ãƒ‰ã«å¿œã˜ã¦é©åˆ‡ã«æ‰±ã£ã¦ãれるよã†ã«ã‚¢ãƒ—リケーショ ンã«å¯¾ã—ã¦é©åˆ‡ãªã‚¨ãƒ©ãƒ¼ã‚’è¿”ã—ã¾ã™ã€‚ç§ãŸã¡ã¯ã€å¿…è¦ã§ã‚れã°ã‚¨ãƒ©ãƒ¼ã‚¿ã‚¤ãƒ—ã‚’ è¿½åŠ ã—ã¾ã™ã€‚ `deprecated` åž‹ã¯ãƒªã‚¯ã‚¨ã‚¹ãƒˆãŒæˆåŠŸã—ã¦ã‚‚è¿”ã•れるã“ã¨ãŒã‚りã¾ã™ã€‚ .. The meta section may also contain a message which provides additional information intended to help developers debug problems. `meta` セクションã¯é–‹ç™ºè€…ãŒå•題を解決ã™ã‚‹æ‰‹åŠ©ã‘ã‚’ã™ã‚‹ã‚ˆã†ãªè¿½åŠ ã®æƒ…å ±ã‚’ `message` ã«å«ã‚“ã§ã„ã‚‹å ´åˆãŒã‚りã¾ã™ã€‚ .. Certan requests may also contain notifications as a top-level item based on a just-submitted checkin or other user actions. é©åˆ‡ãªãƒªã‚¯ã‚¨ã‚¹ãƒˆã¯ **notification** をトップレベルアイテムã«å«ã‚“ã§ã„ã‚‹ å ´åˆãŒã‚りã¾ã™ã€‚ã“れã¯ã€ä»Šã¾ã•ã«checkinã‚„ä»–ã®è¡Œå‹•ã‚’èµ·ã“ã—ãŸã¨ã„ã†æƒ…å ±ã§ã™ã€‚ .. To use JSONP, add a callback=XXX parameter to your request and we will respond with XXX(response). In the case of JSONP, we always return 200 (except in the case of 500's) so the brower will allow the response to be handled by your code, but the true HTTP response code can be obtained from the code in the meta response. JSONPを使ã†ã«ã¯ã€ `callback=XXX` ã¨ã„ã†ãƒ‘ラメータをリクエストã«å«ã‚ã¦ã ã ã•ã„。ãã†ã™ã‚Œã°ã€ XXX(response) ãŒè¿”ã•れã¾ã™ã€‚JSONPã®å ´åˆã€ç§ãŸã¡ã¯ 常ã«(500番å°ä»¥å¤–)ã€200ã‚’è¿”ã—ã¾ã™ã€‚ãã®ãŸã‚ã€ãƒ–ラウザã¯ãƒ¬ã‚¹ãƒãƒ³ã‚¹ã‚’ã‚㪠ãŸã®ã‚³ãƒ¼ãƒ‰ã§æ‰±ãˆã¾ã™ã€‚ã—ã‹ã—ã€æœ¬å½“ã®HTTPレスãƒãƒ³ã‚¹ã‚³ãƒ¼ãƒ‰ã¯ã€ãƒ¬ã‚¹ãƒãƒ³ã‚¹ ã® `meta` 内㮠`code` ã«å«ã¾ã‚Œã¦ã„ã¾ã™ã€‚ ------ エラー ------ .. As much as possible, foursquare attempts to use appropriate HTTP status codes to indicate the general class of problem, and this status code is repeated in the code section of the meta response. å•題を指ã—示ã™ãŸã‚ã«ã€foursquareã¯å¯èƒ½ãªã‹ãŽã‚Šé©åˆ‡ãªHTTPステータスコー ドを使用ã—ã¾ã™ã€‚ãã—ã¦ã€ãã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚³ãƒ¼ãƒ‰ã¯ `meta` レスãƒãƒ³ã‚¹ã® `code` セクションã«ã¦ç¹°ã‚Šè¿”ã•れã¾ã™ã€‚ .. list-table:: :widths: 30 70 * - 400 (Bad Request) - パラメータãŒä¸æ£ãªå ´åˆã€ã‚ã‚‹ã„ã¯ãƒ‘ラメータãŒãªã„å ´åˆã€‚OAuthトークンãŒãªã„å ´åˆã¨resource IDãŒpathã«æ£ã—ãæŒ‡å®šã•れã¦ã„ãªã„å ´åˆã‚’å«ã¿ã¾ã™ã€‚ * - 401 (Unauthorized) - OAuthトークãŒã‚りã¾ã™ãŒä¸æ£ã§ã™ * - 403 (Forbidden) - è¦æ±‚ã•ã‚ŒãŸæƒ…å ±ã¯ç¾åœ¨ã®ãƒ¦ãƒ¼ã‚¶ã¯è¦‹ã‚‰ã‚Œã¾ã›ã‚“。例ãˆã°ã€æƒ…å ±ã‚’èªã¿ãŸã„ユーザã¨friendã§ã¯ãªã„ãªã©ã§ã™ * - 404 (Not Found) - エンドãƒã‚¤ãƒ³ãƒˆãŒã‚りã¾ã›ã‚“ * - 405 (Method Not Allowed) - GETã—ã‹å—ã‘付ã‘ãªã„エンドãƒã‚¤ãƒ³ãƒˆã«POSTを使用ã—ãŸãªã©ãŒè€ƒãˆã‚‰ã‚Œã¾ã™ * - 500 (Internal Server Error) - fousquareã®ã‚µãƒ¼ãƒã¯ä¸å¹¸ã§ã™ã€‚リクエストã¯ãŠãã‚‰ãæ£ã—ã„ã®ã§ã™ãŒå¾Œã»ã©ã‚‚ã†ä¸€åº¦è©¦ã—ã¦ãã ã•ã„ `errorType` ã«è©³ç´°ãŒä»˜ã‘åŠ ãˆã‚‰ã‚Œã¾ã™ã€‚ã“れらã¯å¿…ãšä»¥ä¸‹ã®ä¸ã®ä¸€ã¤ã§ã™ã€‚ .. list-table:: :widths: 30 70 * - invalid_auth - OAuthトークンãŒãªã„ã‹ã€ä¸æ£ã§ã™ * - param_error - è¦æ±‚ã•れãŸãƒ‘ラメータã¯å˜åœ¨ã—ãªã„ã‹ãƒ‘ラメータãŒä¸æ£ã§ã™ã€‚ã“れã¯ãƒ‘スã®ä¸ã®ãƒªã‚½ãƒ¼ã‚¹IDãŒé–“é•ã£ã¦ã„ã‚‹å ´åˆã«ã‚‚èµ·ã“りã¾ã™ * - endpoint_error - リクエストã—ãŸãƒ‘スã¯å˜åœ¨ã—ã¾ã›ã‚“ * - not_authorized - èªè¨¼ã¯æˆåŠŸã—ã¾ã—ãŸãŒã€ãƒ—ライãƒã‚·ãƒ¼åˆ¶é™ã«ã‚ˆã‚Šä½¿ç”¨ã—ã¦ã„るユーザã¯ã“ã®æƒ…å ±ã‚’è¦‹ã‚‰ã‚Œã¾ã›ã‚“ * - rate_limit_exceeded - ã“ã®æ™‚é–“ã§ã®åˆ©ç”¨å›žæ•°åˆ¶é™ã‚’è¶…ãˆã¾ã—㟠* - deprecated - ã“ã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã«é–¢ã™ã‚‹ãªã‚“らã‹ã®æ©Ÿèƒ½ã¯å»ƒæ¢ã•れãŸã€ã‚ã‚‹ã„ã¯ãƒ¬ã‚¹ãƒãƒ³ã‚¹ã®å½¢å¼ãŒå¤‰æ›´ã•れã¾ã—㟠* - server_error - ç¾åœ¨ã‚µãƒ¼ãƒã«å•題ãŒèµ·ãã¦ã„ã¾ã™ã€‚æœ€æ–°æƒ…å ±ã¯ http://status.foursquare.com を見ã¦ãã ã•ã„。 * - other - ãªã‚“らã‹ã®ä»–ã®ç¨®é¡žã®ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ