コンテンツにスキップ
お問い合わせ

NEログインuid・state取得

POST
/users/sign_in
// POST /users/sign_in - NEログインuid・state取得
const params = new URLSearchParams({
client_id: '<client_id>',
// redirect_uri: '...', // optional
})
const res = await fetch('https://base.next-engine.org/users/sign_in', {
method: 'POST',
headers: { 'content-type': 'application/x-www-form-urlencoded' },
body: params,
})
const json = await res.json()
if (json.result !== 'success') throw new Error(json.message ?? json.code)
console.log(json.data)
Media typeapplication/x-www-form-urlencoded
object
client_id
required

ネクストエンジンの「アプリを作る」 -> 該当アプリの「編集」 -> 「API」タブにあるクライアントID / テスト環境で実施する場合は、テスト環境の値を指定する。販売する前には本番環境の値を指定する

string
redirect_uri

ネクストエンジンへのログイン後、リダイレクトするuriを指定する / ネクストエンジンのアプリを作る->APIのRedirect URIのホスト以外を指定することは出来ない

string

Example generated

client_id=example&redirect_uri=example

実行結果 (result が success / error / redirect のいずれか)

Media typeapplication/json
object
uid

アプリを起動したユーザーのuid

string
state

アプリを起動したユーザーのstate / stateには有効期限があります。有効期限が切れた場合は再度本APIを呼ぶ必要があります

string

Example generated

{
"uid": "example",
"state": "example"
}

クライアントエラー (HTTP ステータス自体は 200 + result=error で返ることが多い)

Media typeapplication/json

失敗時の応答。パラメータ共通事項の「成功時以外の出力パラメータ」を参照

object
result
required

Error(code にエラー原因のメッセージコード、message にエラーメッセージ)または redirect(再ログインのため uid・state 取得にリダイレクトする)

string
code

エラーコード

string
message
One of:
string

Example generated

{
"result": "example",
"code": "example",
"message": [
{}
]
}