1、Token生成
接口 : post https://fabric.io/oauth/token 请求头:Headers Content-Type : application/json 正文: body { "grant_type":"password", "scope":"organizations apps issues features account twitter_client_apps beta software answers", "username":"mimimimimi@qq.com", //登录名 "password":"123456789", //登录密码 "client_id":"2c18f8a77609ee6bbac9e53f3768fedc45fb96be0dbcb41defa706dc57d9c931", "client_secret":"092ed1cdde336647b13d44178932cba10911577faf0eda894896188a7d900cc9" }
2、返回值
{ "access_token": "ccccccccccccccccccccccc", "token_type": "bearer", "expires_in": 86400, "refresh_token": "refresh_tokenqqqqqqqqqqqqq", "scope": "organizations apps issues features account twitter_client_apps beta software answers" }
利用 access_token 可以进行后续接口访问。
3、利用 refresh_token 刷新新的token(讲得到的refresh_token<无过期时间>保存下来,刷新token):
接口 : post https://fabric.io/oauth/token 请求头:Headers Content-Type : application/json 正文: body { "grant_type":"refresh_token", "refresh_token":"refresh_tokenqqqqqqqqqqqqq" }
返回值
{ "access_token": "ccccccccccccccccccccccc", "refresh_token": "refresh_tokenqqqqqqqqqqqqq" }
4、请求接口 接口文档出处 https://github.com/strongself/fabricio/blob/develop/docs/api_reference.md
举例两个接口
(1)、GET - https://fabric.io/api/v2/apps
get https://fabric.io/api/v2/apps Headers Authorization: Bearer {access_token}
返回值
1 [ 2 { 3 "id": "11111111", 4 "name": "8888888888", 5 "bundle_identifier": "包名", 6 "base_identifier": "8888888888", 7 "collect_analytics": true, 8 "created_at": "2016-08-01T09:03:47Z", 9 "analytics_app_has_received_data": true, 10 "analytics_forward_to_google_analytics": false, 11 "analytics_include_purchase_events_in_forwarded_events": false, 12 "platform": "android", 13 "status": "activated", 14 "latest_build": null, 15 "icon_url": "https://s3.amazonaws.com555555555icon.png", 16 "icon_hash": null, 17 "kit_versions": null, 18 "sdk_kits": null, 19 "map_of_available_products": null, 20 "firebase_crashlytics": false, 21 "icon32_url": "https://s3.amazonaws.com/assets.crashlytics.com//icon.png", 22 "icon64_url": "https://s3.amazonaws.com/assets.crashlytics.com/production//icon.png", 23 "icon128_url": "https://s3.amazonaws.com/assets.crashlytics.com/production//icon.png", 24 "accounts_count": 23, 25 "organization_id": "1111111111111", 26 "watched": null, 27 "importance_level":