Auth and User
Get the current user
현재 사용자의 정보를 조회합니다.
GET
/
users
/
me
Get the current user
curl --request GET \
--url https://your_a2_service/users/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://your_a2_service/users/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://your_a2_service/users/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your_a2_service/users/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your_a2_service/users/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://your_a2_service/users/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/users/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"budget": 123,
"campaign_count": 1,
"creative_count": 1,
"credit": 123,
"email": "jsmith@example.com",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"is_superuser": true,
"is_verified": true,
"permissions": {},
"placement_count": 1,
"preferences": {
"etc": {
"language": "ko"
},
"notification_methods": {
"email": true,
"slack": false,
"sms": false
},
"notification_methods_data": {
"slack": "<SLACK_WEBHOOK_URL>",
"sms": ""
},
"notifications": {
"attribute_deleted": true,
"campaign_finished": true,
"publish_approval": true,
"publish_request": true
}
},
"role": "advertiser",
"name": "<string>"
}{
"detail": "<string>"
}인증
The access token received from the authorization server in the OAuth 2.0 flow.
응답
Successful Response
유저 스키마
사용자가 현재 이용 가능한 전체 예산
사용자가 소유한 캠페인 수
필수 범위:
x >= 0사용자가 소유한 소재 수
필수 범위:
x >= 0사용자가 현재 이용 가능한 전체 크레딧
유저 이메일
유저 id
사용자 활성 상태 여부
사용자 관리자 여부
사용자 이메일 인증 여부
사용자의 권한 정보
예시:
{}
{ "admin": [], "advertiser": ["permission"], "analytic": ["campaign"], "audience": [], "audience_attribute": ["r"], "audience_segment": ["r", "w"], "campaign": ["r", "w"], "creative": ["r", "w"], "placement": ["r"], "retailer": [] }
{ "admin": ["list_advertisers", "budget"], "advertiser": [], "analytic": ["placement"], "audience": ["r"], "audience_attribute": ["r", "w"], "audience_segment": ["r", "w"], "campaign": ["r"], "creative": ["r", "w"], "placement": ["r", "w"], "retailer": ["approval", "permission"] }
사용자가 소유한 지면 수
필수 범위:
x >= 0사용자 설정 정보
Show child attributes
Show child attributes
유저 역할
사용 가능한 옵션:
advertiser, retailer, admin 사용자 이름
이 페이지가 도움이 되었나요?
⌘I
Get the current user
curl --request GET \
--url https://your_a2_service/users/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://your_a2_service/users/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://your_a2_service/users/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your_a2_service/users/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your_a2_service/users/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://your_a2_service/users/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/users/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"budget": 123,
"campaign_count": 1,
"creative_count": 1,
"credit": 123,
"email": "jsmith@example.com",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"is_superuser": true,
"is_verified": true,
"permissions": {},
"placement_count": 1,
"preferences": {
"etc": {
"language": "ko"
},
"notification_methods": {
"email": true,
"slack": false,
"sms": false
},
"notification_methods_data": {
"slack": "<SLACK_WEBHOOK_URL>",
"sms": ""
},
"notifications": {
"attribute_deleted": true,
"campaign_finished": true,
"publish_approval": true,
"publish_request": true
}
},
"role": "advertiser",
"name": "<string>"
}{
"detail": "<string>"
}