메인 콘텐츠로 건너뛰기
GET
/
v1
/
server
/
coupons
/
user
/
{userId}
유저 쿠폰 사용 내역
curl --request GET \
  --url https://sdk-api.playcamp.io/v1/server/coupons/user/{userId} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://sdk-api.playcamp.io/v1/server/coupons/user/{userId}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://sdk-api.playcamp.io/v1/server/coupons/user/{userId}', 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://sdk-api.playcamp.io/v1/server/coupons/user/{userId}",
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://sdk-api.playcamp.io/v1/server/coupons/user/{userId}"

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://sdk-api.playcamp.io/v1/server/coupons/user/{userId}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://sdk-api.playcamp.io/v1/server/coupons/user/{userId}")

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
{
  "data": [
    {
      "id": 123,
      "userId": "<string>",
      "couponCode": "<string>",
      "packageId": 123,
      "campaignId": "<string>",
      "creatorKey": "<string>",
      "usedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "pagination": {
    "page": 123,
    "limit": 123,
    "total": 123,
    "totalPages": 123
  }
}

인증

Authorization
string
header
필수

Server API Key (format: {keyId}:{secret})

경로 매개변수

userId
string
필수

쿼리 매개변수

page
integer
기본값:1
limit
integer
기본값:20
필수 범위: x <= 100

응답

200 - application/json

성공

data
object[]
필수
pagination
object
필수