그래프 API 버전

페이지 위치

상위 비즈니스 페이지의 다양한 페이지 위치를 나타냅니다. 예를 들어 음식점 체인에서 각 음식점의 페이지가 해당합니다.

모든 앱이 이 에지를 읽을 수 있습니다. 일부 유형의 게시 작업은 일부 개발자에게만 제공됩니다.

이 API의 게시 작업을 사용할 때는 다음 가이드라인을 따르세요.

  • 페이지 생성이나 소유권 주장에 대해 수수료를 청구하지 마세요.
  • 고객이 페이지를 생성하도록 허용하기 전에 기존 장소의 소유권을 주장할 수 있는 기능을 제공하여 페이지 중복을 방지하세요.
  • 가짜 또는 가상 위치가 아닌 실제 물리적 주소가 있는 경우에만 페이지를 생성하세요.
  • 고객을 대신해 페이지를 생성하는 경우 고객 요청 시 해당 페이지의 모든 관리 권한을 양도해야 합니다.
  • 고객의 동의 없이 페이지 관리자를 제삼자에게 공개하지 마세요. 단, 관련 법률, 해당 관할 지역의 법원이나 정부 기관의 규칙 또는 규정, 법적 절차에 따라 공개가 필요한 경우는 예외입니다.

읽기

그래프 API 탐색기
GET /v19.0/{page-id}/locations HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{page-id}/locations',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{page-id}/locations",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/locations",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{page-id}/locations"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

권한

  • 위치를 검색하려면 유효한 액세스 토큰이 필요합니다.

필드

페이지 개체의 배열이며, 각각 비즈니스의 개별적 위치를 나타냅니다.

게시

이 에지에 게시하여 기존의 위치 기반 페이지를 이 리스트에 추가할 수 있습니다.

POST /v19.0/{page-id}/locations HTTP/1.1
Host: graph.facebook.com

main_page_id=%7Bpage-id%7D&store_number=12345&location_page_id=%7Bsubpage-id%7D
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{page-id}/locations',
    array (
      'main_page_id' => '{page-id}',
      'store_number' => '12345',
      'location_page_id' => '{subpage-id}',
    ),
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{page-id}/locations",
    "POST",
    {
        "main_page_id": "{page-id}",
        "store_number": "12345",
        "location_page_id": "{subpage-id}"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("main_page_id", "{page-id}");
params.putString("store_number", "12345");
params.putString("location_page_id", "{subpage-id}");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/locations",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"main_page_id": @"{page-id}",
  @"store_number": @"12345",
  @"location_page_id": @"{subpage-id}",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{page-id}/locations"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

권한

  • 기존 위치를 페이지에 게시하려면 페이지 액세스 토큰이 필요합니다.
  • 새 위치를 생성하고 페이지에 추가하려면 페이지 액세스 토큰이 필요합니다. 일부 개발자만 이 기능에 액세스할 수 있습니다.

필드

이름설명유형

differently_open_offerings

temporary_statusdifferently_open으로 설정하여 비즈니스가 어떻게 평소와 다르게 운영되는지 나타낼 때(예: 음식점에서 테이크아웃 제공) 사용합니다. enum 키는 ONLINE_SERVICES, DELIVERY, PICKUP, OTHER 중 하나 이상일 수 있고 값은 true 또는 false로 설정됩니다. 예를 들어 음식 포장을 제공하지만 배달은 일시 정지하는 음식점은 differently_open_offerings:{"DELIVERY":"false", "PICKUP":"true"}로 설정할 수 있습니다.

object

hours

이 위치의 운영 시간을 정의합니다.

object

{day}_{number}_{status}

하루의 단일 운영 시간 범위를 정의합니다. 각 하루는 시간 범위를 2가지로 지정할 수 있습니다. {day}는 요일의 처음 3자가 되어야 하고, {number}1 또는 2로 지정하여 하루당 두 가지 시간 범위를 허용할 수 있습니다. {status}open 또는 close로 설정하여 시간 범위의 시작이나 끝을 구분해야 합니다. 예를 들어 mon_1_open의 값이 17:00이고 mon_1_close의 값이 21:15이면 월요일 운영 시간은 오후 5시에서 오후 9시 15분까지로 하나의 범위만 설정됩니다.

string

ignore_warnings

이 위치에 대해 개발자가 정의한 임의의 ID이며, 일반적으로 위치의 내부 데이터베이스로 다시 연결하는 데 사용합니다. 필수 필드입니다.

bool

is_franchise

체인점 위치인지 여부입니다.

bool

country

국가 이름. city_id가 포함되지 않으면 필수 항목입니다.

string

city

도시 이름. city_id가 포함되지 않으면 필수 항목입니다.

string

city_id

도시 ID. adcity 타게팅 옵션key 값입니다. 이 값이 포함되지 않으면 citycountry는 필수 항목입니다(미국의 위치는 statezip도 필수 항목입니다).

int

latitude

십진법 기준 위도입니다. location에 필수 항목입니다.

string

location

이 페이지의 위치를 정의합니다. location_page_id를 지정하지 않으면 필수 항목입니다. 이 사전에는 street 키(상세 주소)가 포함되어야 합니다. city_id를 포함하거나 city, statecountry를 모두 포함해야 합니다(하지만 미국 내 주소가 아닌 경우 state는 선택 사항입니다). 미국 내 주소가 아닐 경우 zip 필드도 선택 사항입니다. 도시 ID 생성에 대한 자세한 내용은 이 문서 아래쪽을 참조하세요.

object

longitude

십진법 기준 경도입니다. location에 필수 항목입니다.

string

state

주 이름(또는 그에 준하는 현지 위치).

string

street

상세 주소. location에 필수 항목입니다.

string

zip

위치의 우편번호(또는 그에 준하는 현지 번호).

string

location_page_id

위치로 추가할 Facebook 페이지의 ID. 이 필드를 포함하지 않을 경우 대신 location, place_topicsphone 필드를 지정하여 새 위치 페이지를 만들어야 합니다.

numeric string

main_page_id

모든 위치의 상위에 해당하는 Facebook 페이지의 ID. 이는 필수 필드입니다.

numeric string

permanently_closed

이 위치가 영구적으로 폐쇄되었는지 여부입니다.

bool

phone

이 위치의 전화번호. location_page_id를 지정하지 않으면 필수 항목입니다.

string

pickup_options

이 위치에서 제공하는 픽업 옵션 리스트.

enum[] {CURBSIDE, IN_STORE, OTHER}

place_topics

이 위치에 대한 장소 주제. location_page_id를 지정하지 않으면 필수 항목입니다.

int[]

store_number

이 위치에 대해 개발자가 지정한 임의의 ID이며, 일반적으로 위치의 내부 데이터베이스로 다시 링크하는 데 사용합니다. 이는 필수 필드입니다.

int

temporary_status

페이지에 해당하는 비즈니스가 어떻게 평소와 다르게 운영하는지 나타냅니다. differently_open으로 설정한 경우 differently_open_offerings를 함께 사용하여 상태를 설정합니다.

enum {differently_open, temporarily_closed, operating_as_usual, no_data}

응답

성공할 경우 앱은 다음과 같은 응답을 받습니다.

{
  "success": true
}

실패할 경우 관련 오류 메시지가 반환됩니다.

삭제

위치의 상위 리스트에서 위치 페이지를 삭제하려면 다음 에지에서 삭제하면 됩니다.

DELETE /v19.0/{page-id}/locations HTTP/1.1
Host: graph.facebook.com

main_page_id=%7Bpage-id%7D&store_number=12345&location_page_id=%7Bsubpage-id%7D
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->delete(
    '/{page-id}/locations',
    array (
      'main_page_id' => '{page-id}',
      'store_number' => '12345',
      'location_page_id' => '{subpage-id}',
    ),
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{page-id}/locations",
    "DELETE",
    {
        "main_page_id": "{page-id}",
        "store_number": "12345",
        "location_page_id": "{subpage-id}"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("main_page_id", "{page-id}");
params.putString("store_number", "12345");
params.putString("location_page_id", "{subpage-id}");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/locations",
    params,
    HttpMethod.DELETE,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"main_page_id": @"{page-id}",
  @"store_number": @"12345",
  @"location_page_id": @"{subpage-id}",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{page-id}/locations"
                                      parameters:params
                                      HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

권한

  • 상위 페이지에서 위치를 삭제하려면 페이지 액세스 토큰이 필요합니다.

필드

모든 필드는 필수입니다.

이름 설명 유형

main_page_id

이 위치의 기본 Facebook 페이지 ID입니다.

numeric string

store_number

이 위치에 대해 개발자가 정의한 ID입니다.

numeric string

location_page_id

이 위치에 대해 Facebook이 정의한 ID입니다.

numeric string

응답

성공한 경우:

{
  "success": true
}

실패할 경우 관련 오류 메시지가 반환됩니다.

업데이트

이 엔드포인트는 새 페이지 환경에 지원됩니다.

POST /v19.0/{page-id}/locations HTTP/1.1
Host: graph.facebook.com

main_page_id=%7Bpage-id%7D&store_number=12345&location_page_id=%7Bsubpage-id%7D
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{page-id}/locations',
    array (
      'main_page_id' => '{page-id}',
      'store_number' => '12345',
      'location_page_id' => '{subpage-id}',
    ),
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{page-id}/locations",
    "POST",
    {
        "main_page_id": "{page-id}",
        "store_number": "12345",
        "location_page_id": "{subpage-id}"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("main_page_id", "{page-id}");
params.putString("store_number", "12345");
params.putString("location_page_id", "{subpage-id}");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/locations",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"main_page_id": @"{page-id}",
  @"store_number": @"12345",
  @"location_page_id": @"{subpage-id}",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{page-id}/locations"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

권한

  • 상위 페이지에서 위치를 업데이트하려면 페이지 액세스 토큰이 필요합니다.

필드

업데이트하려면 필수 게시 필드와 값을 변경하려는 다른 게시 필드를 모두 포함하세요.

응답

성공한 경우:

{
  "success": true
}

실패할 경우 관련 오류 메시지가 반환됩니다.