개발자를 위한 API 참조 v3

시작하기

시스템에서 요청을 처리하기 위해서는 API키가 필요합니다. 사용자가 등록을 하면 이 사용자에 대한 API키가 자동으로 생성됩니다. API키는 각 요청과 함께 전송되어야 합니다(아래 전체 예 참조). API키가 전송되지 않거나 만료되면 오류가 발생합니다. 남용되지 않도록 API키를 비밀로 해주시기 바랍니다.

인증

API 시스템으로 인증하기 위해서는 각각의 요청과 함께 API키를 인증 토큰으로 보내주셔야 합니다. 아래 샘플 코드를 보시면 됩니다.

curl --location --request POST 'https://me2.kr/api/url/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \ 
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/url/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer YOURAPIKEY",
    "Content-Type: application/json",
    ),
));

$response = curl_exec($curl);
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://me2.kr/api/account',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: ''
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
속도제한

우리 API에는 안정성을 극대화하기 위해 요청 급증을 방지하는 속도 제한기가 있습니다. 우리의 비율 제한은 현재 1분당 30개의 요청으로 제한됩니다.

응답과 함께 여러 개의 헤더가 전송되며, 이러한 헤더를 검사하여 요청에 대한 다양한 정보를 확인할 수 있습니다.

X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: TIMESTAMP
응답처리

모든 API 응답은 기본적으로 JSON 형식으로 반환됩니다. 이를 사용 가능한 데이터로 변환하기 위해서는 언어에 따라 적절한 기능을 사용해야 할 것입니다. PHP에서는 json_decode() 함수를 사용하여 객체(기본값) 또는 배열(두 번째 파라미터를 true로 설정)로 데이터를 변환할 수 있습니다. 오류 여부에 대한 정보를 제공하므로 오류 키를 확인하는 것이 매우 중요합니다. 헤더 코드도 확인할 수 있습니다.

{
    "error": 1,
    "message": "An error ocurred"
}

CTA 오버레이 팝업

CTA 오버레이 나열
GET https://me2.kr/api/overlay?limit=2&page=1

이 endpoint를 사용하면 API를 통해 cta overlay를 얻을 수 있습니다. 데이터를 필터링할 수도 있습니다(자세한 내용은 표 참조).

매개 변수메모
limit (선택사항) 페이지당 데이터 결과
page (선택사항) 현재 페이지 요청
curl --location --request GET 'https://me2.kr/api/overlay?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/overlay?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://me2.kr/api/overlay?limit=2&page=1',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "cta": [
            {
                "id": 1,
                "type": "message",
                "name": "Product 1 Promo",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "type": "contact",
                "name": "Contact Page",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

QR코드 전용

QR 코드 나열
GET https://me2.kr/api/qr?limit=2&page=1

이 endpoint를 사용하면 API를 통해 QR코드를 얻을 수 있습니다. 데이터를 필터링할 수도 있습니다(자세한 내용은 표 참조).

매개 변수메모
limit (선택사항) 페이지당 데이터 결과
page (선택사항) 현재 페이지 요청
curl --location --request GET 'https://me2.kr/api/qr?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/qr?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://me2.kr/api/qr?limit=2&page=1',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "qrs": [
            {
                "id": 2,
                "link": "https:\/\/me2.kr\/qr\/a2d5e",
                "scans": 0,
                "name": "Google",
                "date": "2020-11-10 18:01:43"
            },
            {
                "id": 1,
                "link": "https:\/\/me2.kr\/qr\/b9edfe",
                "scans": 5,
                "name": "Google Canada",
                "date": "2020-11-10 18:00:25"
            }
        ]
    }
}
단일 QR 코드 받기
GET https://me2.kr/api/qr/:id

API를 통해 단일 QR 코드에 대한 세부 정보를 얻으려면 이 엔드포인트를 사용할 수 있습니다.

curl --location --request GET 'https://me2.kr/api/qr/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/qr/:id",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://me2.kr/api/qr/:id',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "details": {
        "id": 1,
        "link": "https:\/\/me2.kr\/qr\/b9edfe",
        "scans": 5,
        "name": "Google Canada",
        "date": "2020-11-10 18:00:25"
    },
    "data": {
        "clicks": 1,
        "uniqueClicks": 1,
        "topCountries": {
            "Unknown": "1"
        },
        "topReferrers": {
            "Direct, email and other": "1"
        },
        "topBrowsers": {
            "Chrome": "1"
        },
        "topOs": {
            "Windows 10": "1"
        },
        "socialCount": {
            "facebook": 0,
            "twitter": 0,
            "instagram": 0
        }
    }
}
QR코드 만들기
POST https://me2.kr/api/qr/add

QR 코드를 작성하려면 POST 요청을 통해 유효한 데이터를 JSON으로 전송해야 합니다. 아래와 같이 요청의 원본으로 데이터를 전송해야 합니다. 아래 예제는 전송할 수 있는 모든 매개 변수를 보여주지만 모두 전송해야 하는 것은 아닙니다(자세한 내용은 표 참조).

매개 변수메모
type (required) text | vcard | link | email | phone | sms | wifi
data (필수) QR코드 내부에 내장되는 데이터 종류에 따라 string 또는 array가 가능합니다
background (optional) RGB color e.g. rgb(255,255,255)
foreground (optional) RGB color e.g. rgb(0,0,0)
logo (선택사항) 로고의 경로 png 또는 jpg
curl --location --request POST 'https://me2.kr/api/qr/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/qr/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'type' => 'link',
  'data' => 'https://google.com',
  'background' => 'rgb(255,255,255)',
  'foreground' => 'rgb(0,0,0)',
  'logo' => 'https://site.com/logo.png',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://me2.kr/api/qr/add',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png"
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "id": 3,
    "link": "https:\/\/me2.kr\/qr\/a58f79"
}
QR코드 업데이트
PUT https://me2.kr/api/qr/:id/update

QR 코드를 업데이트하려면 유효한 데이터를 PUT 요청을 통해 JSON으로 전송해야 합니다. 아래와 같이 요청의 원본으로 데이터를 전송해야 합니다. 아래 예제는 전송할 수 있는 모든 매개 변수를 보여주지만 모두 전송해야 하는 것은 아닙니다(자세한 내용은 표 참조).

매개 변수메모
data (필수) QR코드 내부에 내장되는 데이터 종류에 따라 string 또는 array가 가능합니다
background (optional) RGB color e.g. rgb(255,255,255)
foreground (optional) RGB color e.g. rgb(0,0,0)
logo (선택사항) 로고의 경로 png 또는 jpg
curl --location --request PUT 'https://me2.kr/api/qr/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/qr/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'type' => 'link',
  'data' => 'https://google.com',
  'background' => 'rgb(255,255,255)',
  'foreground' => 'rgb(0,0,0)',
  'logo' => 'https://site.com/logo.png',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'PUT',
    'url': 'https://me2.kr/api/qr/:id/update',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png"
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "QR has been updated successfully."
}
QR코드 삭제
DELETE https://me2.kr/api/qr/:id/delete

QR코드를 삭제하려면 DELETE 요청을 보내야 합니다.

curl --location --request DELETE 'https://me2.kr/api/qr/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/qr/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'DELETE',
    'url': 'https://me2.kr/api/qr/:id/delete',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "QR Code has been deleted successfully."
}

계정

계정 가져오기
GET https://me2.kr/api/account

계정에 대한 정보를 얻으려면 이 엔드포인트로 요청을 보내면 계정에 대한 데이터가 반환됩니다.

curl --location --request GET 'https://me2.kr/api/account' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/account",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://me2.kr/api/account',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "data": {
        "id": 1,
        "email": "[email protected]",
        "username": "sampleuser",
        "avatar": "https:\/\/domain.com\/content\/avatar.png",
        "status": "pro",
        "expires": "2022-11-15 15:00:00",
        "registered": "2020-11-10 18:01:43"
    }
}
계정 업데이트
PUT https://me2.kr/api/account/update

계정 정보를 업데이트하려면 이 엔드포인트에 요청을 보내면 계정의 데이터가 업데이트됩니다.

curl --location --request PUT 'https://me2.kr/api/account/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "[email protected]",
    "password": "newpassword"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/account/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'email' => '[email protected]',
  'password' => 'newpassword',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'PUT',
    'url': 'https://me2.kr/api/account/update',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "email": "[email protected]",
    "password": "newpassword"
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "Account has been successfully updated."
}

내 도메인으로 링크 생성

브랜드 도메인 나열
GET https://me2.kr/api/domains?limit=2&page=1

API를 통해 브랜드 도메인을 얻으려면 이 엔드포인트를 사용할 수 있습니다. 데이터를 필터링할 수도 있습니다(자세한 내용은 표 참조).

매개 변수메모
limit (선택사항) 페이지당 데이터 결과
page (선택사항) 현재 페이지 요청
curl --location --request GET 'https://me2.kr/api/domains?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/domains?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://me2.kr/api/domains?limit=2&page=1',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "domains": [
            {
                "id": 1,
                "domain": "https:\/\/domain1.com",
                "redirectroot": "https:\/\/rootdomain.com",
                "redirect404": "https:\/\/rootdomain.com\/404"
            },
            {
                "id": 2,
                "domain": "https:\/\/domain2.com",
                "redirectroot": "https:\/\/rootdomain2.com",
                "redirect404": "https:\/\/rootdomain2.com\/404"
            }
        ]
    }
}
브랜드 도메인 생성
POST https://me2.kr/api/domain/add

이 끝점을 사용하여 도메인을 추가할 수 있습니다. 도메인이 당사 서버를 올바르게 가리키는지 확인하십시오.

매개 변수메모
domain (필수) http 또는 https를 포함한 브랜드 도메인
redirectroot (선택사항) 누군가가 도메인을 방문할 때 루트 리디렉션
redirect404 (선택사항) 사용자 지정 404 리디렉션
curl --location --request POST 'https://me2.kr/api/domain/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "domain": "https:\/\/domain1.com",
    "redirectroot": "https:\/\/rootdomain.com",
    "redirect404": "https:\/\/rootdomain.com\/404"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/domain/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'domain' => 'https://domain1.com',
  'redirectroot' => 'https://rootdomain.com',
  'redirect404' => 'https://rootdomain.com/404',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://me2.kr/api/domain/add',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "domain": "https:\/\/domain1.com",
    "redirectroot": "https:\/\/rootdomain.com",
    "redirect404": "https:\/\/rootdomain.com\/404"
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "id": 1
}
도메인 업데이트
PUT https://me2.kr/api/domain/:id/update

브랜드 도메인을 업데이트하려면 유효한 데이터를 PUT 요청을 통해 JSON으로 전송해야 합니다. 아래와 같이 요청의 원본으로 데이터를 전송해야 합니다. 아래 예제는 전송할 수 있는 모든 매개 변수를 보여주지만 모든 매개 변수를 전송할 필요는 없습니다(자세한 내용은 표 참조).

매개 변수메모
redirectroot (선택사항) 누군가가 도메인을 방문할 때 루트 리디렉션
redirect404 (선택사항) 사용자 지정 404 리디렉션
curl --location --request PUT 'https://me2.kr/api/domain/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "redirectroot": "https:\/\/rootdomain-new.com",
    "redirect404": "https:\/\/rootdomain-new.com\/404"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/domain/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'redirectroot' => 'https://rootdomain-new.com',
  'redirect404' => 'https://rootdomain-new.com/404',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'PUT',
    'url': 'https://me2.kr/api/domain/:id/update',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "redirectroot": "https:\/\/rootdomain-new.com",
    "redirect404": "https:\/\/rootdomain-new.com\/404"
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "Domain has been updated successfully."
}
도메인 삭제
DELETE https://me2.kr/api/domain/:id/delete

도메인을 삭제하려면 DELETE 요청을 보내야 합니다.

curl --location --request DELETE 'https://me2.kr/api/domain/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/domain/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'DELETE',
    'url': 'https://me2.kr/api/domain/:id/delete',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "Domain has been deleted successfully."
}

링크들


채널

채널 목록
GET https://me2.kr/api/channels?limit=2&page=1

API를 통해 채널을 가져오려면 이 엔드포인트를 사용하면 됩니다. 데이터를 필터링할 수도 있습니다(자세한 내용은 표 참조).

매개 변수메모
limit (선택사항) 페이지당 데이터 결과
page (선택사항) 현재 페이지 요청
curl --location --request GET 'https://me2.kr/api/channels?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/channels?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://me2.kr/api/channels?limit=2&page=1',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "channels": [
            {
                "id": 1,
                "name": "Channel 1",
                "description": "Description of channel 1",
                "color": "#000000",
                "starred": true
            },
            {
                "id": 2,
                "name": "Channel 2",
                "description": "Description of channel 2",
                "color": "#FF0000",
                "starred": false
            }
        ]
    }
}
채널 항목 나열
GET https://me2.kr/api/channel/:id?limit=1&page=1

API를 통해 선택한 채널에 항목을 가져오려면 이 엔드포인트를 사용하면 됩니다. 데이터를 필터링할 수도 있습니다(자세한 내용은 표 참조).

매개 변수메모
limit (선택사항) 페이지당 데이터 결과
page (선택사항) 현재 페이지 요청
curl --location --request GET 'https://me2.kr/api/channel/:id?limit=1&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/channel/:id?limit=1&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://me2.kr/api/channel/:id?limit=1&page=1',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "items": [
            {
                "type": "links",
                "id": 1,
                "title": "My Sample Link",
                "preview": "https:\/\/google.com",
                "link": "https:\/\/me2.kr\/google",
                "date": "2022-05-12"
            },
            {
                "type": "bio",
                "id": 1,
                "title": "My Sample Bio",
                "preview": "https:\/\/me2.kr\/mybio",
                "link": "https:\/\/me2.kr\/mybio",
                "date": "2022-06-01"
            }
        ]
    }
}
채널 만들기
POST https://me2.kr/api/channel/add

이 끝점을 사용하여 채널을 추가할 수 있습니다.

매개 변수메모
name (필수) 채널명
description (선택사항) 채널 설명
color (선택사항) 채널 배지 색상(HEX)
starred (선택사항) 채널 별 표시 여부(참 또는 거짓)
curl --location --request POST 'https://me2.kr/api/channel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/channel/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'name' => 'New Channel',
  'description' => 'my new channel',
  'color' => '#000000',
  'starred' => true,
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://me2.kr/api/channel/add',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "id": 3,
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}
채널에 항목 할당
POST https://me2.kr/api/channel/:channelid/assign/:type/:itemid

채널 id, 아이템 종류(링크, 바이오 또는 qr), 아이템 id와 함께 요청을 보내면 어떤 채널에도 아이템을 할당할 수 있습니다.

매개 변수메모
:channelid (필수) 채널 ID
:type (required) 링크 또는 바이오 또는 qr
:itemid (필수) 아이템 ID
curl --location --request POST 'https://me2.kr/api/channel/:channelid/assign/:type/:itemid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/channel/:channelid/assign/:type/:itemid",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://me2.kr/api/channel/:channelid/assign/:type/:itemid',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "Item successfully added to the channel."
}
채널 업데이트
PUT https://me2.kr/api/channel/:id/update

채널을 업데이트하려면 PUT 요청을 통해 JSON으로 유효한 데이터를 보내야 합니다. 데이터는 아래와 같이 요청의 원시 본문으로 전송되어야 합니다. 아래 예는 보낼 수 있는 모든 매개변수를 보여 주지만 모두 보낼 필요는 없습니다(자세한 내용은 표 참조).

매개 변수메모
name (optional) Channel name
description (선택사항) 채널 설명
color (선택사항) 채널 배지 색상(HEX)
starred (선택사항) 채널 별 표시 여부(참 또는 거짓)
curl --location --request PUT 'https://me2.kr/api/channel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Acme Corp",
    "description": "channel for items for Acme Corp",
    "color": "#FFFFFF",
    "starred": false
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/channel/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'name' => 'Acme Corp',
  'description' => 'channel for items for Acme Corp',
  'color' => '#FFFFFF',
  'starred' => false,
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'PUT',
    'url': 'https://me2.kr/api/channel/:id/update',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "name": "Acme Corp",
    "description": "channel for items for Acme Corp",
    "color": "#FFFFFF",
    "starred": false
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "Channel has been updated successfully."
}
채널 삭제
DELETE https://me2.kr/api/channel/:id/delete

채널을 삭제하시려면 DELETE 요청을 보내주셔야 합니다. 모든 항목에 대한 할당이 해제됩니다.

curl --location --request DELETE 'https://me2.kr/api/channel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/channel/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'DELETE',
    'url': 'https://me2.kr/api/channel/:id/delete',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "Channel has been deleted successfully."
}

캠페인

캠페인 목록
GET https://me2.kr/api/campaigns?limit=2&page=1

API를 통해 캠페인을 얻으려면 이 엔드포인트를 사용하면 됩니다. 데이터를 필터링할 수도 있습니다(자세한 내용은 표 참조).

매개 변수메모
limit (선택사항) 페이지당 데이터 결과
page (선택사항) 현재 페이지 요청
curl --location --request GET 'https://me2.kr/api/campaigns?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/campaigns?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://me2.kr/api/campaigns?limit=2&page=1',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "campaigns": [
            {
                "id": 1,
                "name": "Sample Campaign",
                "public": false,
                "rotator": false,
                "list": "https:\/\/domain.com\/u\/admin\/list-1"
            },
            {
                "id": 2,
                "domain": "Facebook Campaign",
                "public": true,
                "rotator": "https:\/\/domain.com\/r\/test",
                "list": "https:\/\/domain.com\/u\/admin\/test-2"
            }
        ]
    }
}
캠페인 만들기
POST https://me2.kr/api/campaign/add

이 엔드포인트를 사용하여 캠페인을 추가할 수 있습니다.

매개 변수메모
name (선택사항) 캠페인 이름
slug (선택 사항) 회전 장치 슬러그
public (선택사항) 접근
curl --location --request POST 'https://me2.kr/api/campaign/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "New Campaign",
    "slug": "new-campaign",
    "public": true
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/campaign/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'name' => 'New Campaign',
  'slug' => 'new-campaign',
  'public' => true,
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://me2.kr/api/campaign/add',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "name": "New Campaign",
    "slug": "new-campaign",
    "public": true
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "id": 3,
    "domain": "New Campaign",
    "public": true,
    "rotator": "https:\/\/domain.com\/r\/new-campaign",
    "list": "https:\/\/domain.com\/u\/admin\/new-campaign-3"
}
캠페인에 링크 할당
POST https://me2.kr/api/campaign/:campaignid/assign/:linkid

이 엔드포인트를 사용하여 캠페인에 짧은 링크를 할당할 수 있습니다. 엔드포인트에는 캠페인 ID와 짧은 링크 ID가 필요합니다.

curl --location --request POST 'https://me2.kr/api/campaign/:campaignid/assign/:linkid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/campaign/:campaignid/assign/:linkid",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://me2.kr/api/campaign/:campaignid/assign/:linkid',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "Link successfully added to the campaign."
}
캠페인 업데이트
PUT https://me2.kr/api/campaign/:id/update

캠페인을 업데이트하려면 PUT 요청을 통해 유효한 데이터를 JSON으로 전송해야 합니다. 아래와 같이 요청의 원본으로 데이터를 전송해야 합니다. 아래 예제는 전송할 수 있는 모든 매개 변수를 보여주지만 모든 매개 변수를 전송할 필요는 없습니다(자세한 내용은 표 참조).

매개 변수메모
name (필수) 캠페인 이름
slug (선택 사항) 회전 장치 슬러그
public (선택사항) 접근
curl --location --request PUT 'https://me2.kr/api/campaign/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Twitter Campaign",
    "slug": "twitter-campaign",
    "public": true
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/campaign/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'name' => 'Twitter Campaign',
  'slug' => 'twitter-campaign',
  'public' => true,
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'PUT',
    'url': 'https://me2.kr/api/campaign/:id/update',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "name": "Twitter Campaign",
    "slug": "twitter-campaign",
    "public": true
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "id": 3,
    "domain": "Twitter Campaign",
    "public": true,
    "rotator": "https:\/\/domain.com\/r\/twitter-campaign",
    "list": "https:\/\/domain.com\/u\/admin\/twitter-campaign-3"
}
캠페인 삭제
DELETE https://me2.kr/api/campaign/:id/delete

캠페인을 삭제하려면 DELETE 요청을 보내야 합니다.

curl --location --request DELETE 'https://me2.kr/api/campaign/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/campaign/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'DELETE',
    'url': 'https://me2.kr/api/campaign/:id/delete',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "Campaign has been deleted successfully."
}

커스텀 스플레시

List Custom Splash
GET https://me2.kr/api/splash?limit=2&page=1

API를 통해 사용자 지정 스플래시 페이지를 가져오려면 이 엔드포인트를 사용하면 됩니다. 데이터를 필터링할 수도 있습니다(자세한 내용은 표 참조).

매개 변수메모
limit (선택사항) 페이지당 데이터 결과
page (선택사항) 현재 페이지 요청
curl --location --request GET 'https://me2.kr/api/splash?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/splash?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://me2.kr/api/splash?limit=2&page=1',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "splash": [
            {
                "id": 1,
                "name": "Product 1 Promo",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "name": "Product 2 Promo",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

파일

List Files
GET https://me2.kr/api/files?limit=2&page=1

Get all of your files. You can also search by name.

매개 변수메모
name (optional) Search for a file by name
limit (선택사항) 페이지당 데이터 결과
page (선택사항) 현재 페이지 요청
curl --location --request GET 'https://me2.kr/api/files?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/files?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://me2.kr/api/files?limit=2&page=1',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "result": 3,
    "perpage": 15,
    "currentpage": 1,
    "nextpage": null,
    "maxpage": 1,
    "list": [
        {
            "id": 1,
            "name": "My Photo",
            "downloads": 10,
            "shorturl": "https:\/\/me2.kr\/QIPcM",
            "date": "2022-08-09 17:00:00"
        },
        {
            "id": 2,
            "name": "My Documents",
            "downloads": 15,
            "shorturl": "https:\/\/me2.kr\/fMcnK",
            "date": "2022-08-10 17:01:00"
        },
        {
            "id": 3,
            "name": "My Files",
            "downloads": 5,
            "shorturl": "https:\/\/me2.kr\/spkur",
            "date": "2022-08-11 19:01:00"
        }
    ]
}
Upload a file
POST https://me2.kr/api/files/upload/:filename?name=My+File

Upload a file by sending the binary data as the post body. You need to send the file name including the extension instead of :filename in the url (e.g. brandkit.zip). You can set options by sending the following parameters.

매개 변수메모
name (optional) File name
custom (선택 사항) 임의의 별칭 대신 사용자 정의 별칭입니다.
domain (선택사항) 사용자 정의 도메인
password (선택 사항) 비밀번호 보호
expiry (optional) Expiration for the download example 2021-09-28
maxdownloads (optional) Maximum number of downloads
curl --location --request POST 'https://me2.kr/api/files/upload/:filename?name=My+File' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '"BINARY DATA"'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/files/upload/:filename?name=My+File",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode('BINARY DATA'),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://me2.kr/api/files/upload/:filename?name=My+File',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify("BINARY DATA"),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "id": 1,
    "shorturl": "https:\/\/me2.kr\/NMFrt"
}

픽셀

픽셀 목록
GET https://me2.kr/api/pixels?limit=2&page=1

이 엔드포인트를 사용하면 API를 통해 픽셀 코드를 얻을 수 있습니다. 데이터를 필터링할 수도 있습니다(자세한 내용은 표 참조).

매개 변수메모
limit (선택사항) 페이지당 데이터 결과
page (선택사항) 현재 페이지 요청
curl --location --request GET 'https://me2.kr/api/pixels?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/pixels?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'GET',
    'url': 'https://me2.kr/api/pixels?limit=2&page=1',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "pixels": [
            {
                "id": 1,
                "type": "gtmpixel",
                "name": "GTM Pixel",
                "tag": "GA-123456789",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "type": "twitterpixel",
                "name": "Twitter Pixel",
                "tag": "1234567",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}
픽셀 만들기
POST https://me2.kr/api/pixel/add

이 끝점을 사용하면 픽셀을 만들 수 있습니다. 픽셀 종류와 태그를 보내주셔야 합니다.

매개 변수메모
type (required) gtmpixel | gapixel | fbpixel | adwordspixel | linkedinpixel | twitterpixel | adrollpixel | quorapixel | pinterest | bing | snapchat | reddit | tiktok | kakao
name (필수) 픽셀의 맞춤 이름
tag (필수) 픽셀의 태그
curl --location --request POST 'https://me2.kr/api/pixel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "gtmpixel",
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/pixel/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'type' => 'gtmpixel',
  'name' => 'My GTM',
  'tag' => 'GTM-ABCDE',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://me2.kr/api/pixel/add',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "type": "gtmpixel",
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "id": 1
}
픽셀 업데이트
PUT https://me2.kr/api/pixel/:id/update

픽셀을 업데이트하려면 유효한 데이터를 PUT 요청을 통해 JSON으로 전송해야 합니다. 아래와 같이 요청의 원본으로 데이터를 전송해야 합니다. 아래 예제는 전송할 수 있는 모든 파라미터를 보여주지만 모든 파라미터를 전송할 필요는 없습니다(자세한 내용은 표 참조).

매개 변수메모
name (선택사항) 픽셀의 사용자 지정 이름
tag (필수) 픽셀의 태그
curl --location --request PUT 'https://me2.kr/api/pixel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/pixel/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'name' => 'My GTM',
  'tag' => 'GTM-ABCDE',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'PUT',
    'url': 'https://me2.kr/api/pixel/:id/update',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}),
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "Pixel has been updated successfully."
}
픽셀 삭제
DELETE https://me2.kr/api/pixel/:id/delete

픽셀을 삭제하려면 DELETE 요청을 보내야 합니다.

curl --location --request DELETE 'https://me2.kr/api/pixel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://me2.kr/api/pixel/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var request = require('request');
var options = {
    'method': 'DELETE',
    'url': 'https://me2.kr/api/pixel/:id/delete',
    'headers': {
        'Authorization': 'Bearer YOURAPIKEY',
        'Content-Type': 'application/json'
    },
    
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});
Server response
{
    "error": 0,
    "message": "Pixel has been deleted successfully."
}