龙空技术网

API json返回格式API json返回格式

鬼谷子学术 284

前言:

此时小伙伴们对“jsonp返回html”都比较关切,看官们都需要了解一些“jsonp返回html”的相关知识。那么小编也在网摘上收集了一些对于“jsonp返回html””的相关资讯,希望小伙伴们能喜欢,同学们快快来学习一下吧!

API json返回格式Gitlab

Gitlab访问token响应应该包括如下属性:

访问token返回json格式

例如:成功的令牌响应可能如下

HTTP/1.1 200 OK

Content-Type: application/json

Cache-Control: no-store

Pragma: no-cache

{

"access_token":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3",

"token_type":"bearer",

"expires_in":3600,

"refresh_token":"IwOGYzYTlmM2YxOTQ5MGE3YmNmMDFkNTVk",

"scope":"create"

}

访问User APIFor user

GET /api/v4/user

{"id":258,"name":"张三","username":"123456","state":"active","avatar_url":"\u0026d=identicon","web_url":" 68.1.1000/123456","created_at":"2019-09-05T08:47:11.908Z","bio":"","location":"","public_email":"","skype":"","linkedin":"","twitter":"","website_url":"","organization":"","last_sign_in_at":"2019-12-04T09:47:16.848Z","confirmed_at":"2019-09-05T08:47:48.870Z","last_activity_on":"2019-12-12","email":"robin.b.chen@mail.foxconn.com","theme_id":1,"color_scheme_id":1,"projects_limit":100000,"current_sign_in_at":"2019-12-07T09:24:28.335Z","identities":[],"can_create_group":true,"can_create_project":true,"two_factor_enabled":false,"external":false,"private_profile":false}

参考地址

Githubtoken响应格式

Accept: application/json

{"access_token":"e72e16c7e42f292c6912e7710c838347ae178b4a", "scope":"repo,gist", "token_type":"bearer"}

Accept: application/xml

<OAuth>

<token_type>bearer</token_type>

<scope>repo,gist</scope>

<access_token>e72e16c7e42f292c6912e7710c838347ae178b4a</access_token>

</OAuth>

User API

Get the authenticated user

GET /user

{

"login": "octocat",

"id": 1,

"node_id": "MDQ6VXNlcjE=",

"avatar_url": ";,

"gravatar_id": "",

"url": ";,

"html_url": ";,

"followers_url": ";,

"following_url": "{/other_user}",

"gists_url": "{/gist_id}",

"starred_url": "{/owner}{/repo}",

"subscriptions_url": ";,

"organizations_url": ";,

"repos_url": ";,

"events_url": "{/privacy}",

"received_events_url": ";,

"type": "User",

"site_admin": false,

"name": "monalisa octocat",

"company": "GitHub",

"blog": ";,

"location": "San Francisco",

"email": "octocat@github.com",

"hireable": false,

"bio": "There once was...",

"public_repos": 2,

"public_gists": 1,

"followers": 20,

"following": 0,

"created_at": "2008-01-14T04:33:35Z",

"updated_at": "2008-01-14T04:33:35Z",

"private_gists": 81,

"total_private_repos": 100,

"owned_private_repos": 100,

"disk_usage": 10000,

"collaborators": 8,

"two_factor_authentication": true,

"plan": {

"name": "Medium",

"space": 400,

"private_repos": 20,

"collaborators": 0

}

}

参考地址

Keycloak

响应结构

名称

说明

access_token

获取到的凭证

expires_in

凭证有效时间;单位:秒

refresh_expires_in

刷新凭证过期时间;单位:秒

refresh_token

凭证过期后用于获取新的凭证

token_type

凭证种类

Token返回格式

{  "access_token":"xxx",  "expires_in":300,  "refresh_expires_in":1800,  "refresh_token":"xxx",  "token_type":"bearer",  "not-before-policy":0,  "session_state":"0dd081f8-caaf-4c3c-8f5e-d45f707f5569",  "scope":"email profile"}
User API

参考地址

OktaToken响应案例

User api

以下包含有关的当前经过身份验证的用户声明

{

"sub": "00uid4BxXw6I6TV4m0g3",

"name" :"John Doe",

"nickname":"Jimmy",

"given_name":"John",

"middle_name":"James",

"family_name":"Doe",

"profile":";,

"zoneinfo":"America/Los_Angeles",

"locale":"en-US",

"updated_at":1234678910,

"email":"john.doe@example.com",

"email_verified":true,

"address" : { "street_address":"123 Hollywood Blvd.", "locality":"Los Angeles", "region":"CA", "postal_code":"90210", "country":"US" },

"phone_number":"+1 (425) 555-1212"

}

参考地址

标签: #jsonp返回html