Versão Graph API

Business Owned Businesses

Leitura

The client businesses owned.

Exemplo

Graph API Explorer
GET /v21.0/{business-id}/owned_businesses 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(
    '/{business-id}/owned_businesses',
    '{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(
    "/{business-id}/owned_businesses",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{business-id}/owned_businesses",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{business-id}/owned_businesses"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
Se quiser saber como usar a Graph API, leia nosso guia sobre Como usar a Graph API.

Parâmetros

ParâmetroDescrição
child_business_external_id
string

It's the external ID provided by aggregator business to identify child business on their side.

client_user_id
UID

client_user_id

Campos

A leitura desta borda retornará um resultado formatado em JSON:

{ "data": [], "paging": {}, "summary": {} }

data

Uma lista de nós Business.

Os seguintes campos serão adicionados a cada nó que for retornado:

CampoDescrição
relationship

relationship

paging

Para saber mais detalhes sobre paginação, consulte o Guia da Graph API.

summary

Informações agregadas sobre a borda, como contagens. Especifique os campos a serem buscados no parâmetro de resumo (como summary=total_count).

CampoDescrição
total_count
int32

Total number of objects on this edge

Error Codes

ErroDescrição
200Permissions error

Criando

To create other Business Managers, your business needs to obtain BUSINESS_MANAGEMENT during the app review process. If your app is in development mode, you can surpass this requirement, but to create only two child businesses.

You can make a POST request to owned_businesses edge from the following paths:
When posting to this edge, a Business will be created.

Parâmetros

ParâmetroDescrição
name
string

name

Obrigatório
page_permitted_tasks
array<enum {MANAGE, CREATE_CONTENT, MODERATE, MESSAGING, ADVERTISE, ANALYZE, MODERATE_COMMUNITY, MANAGE_JOBS, PAGES_MESSAGING, PAGES_MESSAGING_SUBSCRIPTIONS, READ_PAGE_MAILBOXES, VIEW_MONETIZATION_INSIGHTS, MANAGE_LEADS, PROFILE_PLUS_FULL_CONTROL, PROFILE_PLUS_MANAGE, PROFILE_PLUS_FACEBOOK_ACCESS, PROFILE_PLUS_CREATE_CONTENT, PROFILE_PLUS_MODERATE, PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY, PROFILE_PLUS_MESSAGING, PROFILE_PLUS_ADVERTISE, PROFILE_PLUS_ANALYZE, PROFILE_PLUS_REVENUE, PROFILE_PLUS_MANAGE_LEADS, CASHIER_ROLE}>

page_permitted_tasks

sales_rep_email
string

sales_rep_email

shared_page_id
numeric string

shared_page_id

should_generate_name
boolean

should_generate_name This parameter allows the automatic creation of a Child Business Manager when set to true, using a cleaned version of the name provided in the required name parameter. If this option is used, the updated name will be returned as part of the API response.

survey_business_type
enum {AGENCY, ADVERTISER, APP_DEVELOPER, PUBLISHER}

survey_business_type

survey_num_assets
int64

survey_num_assets

survey_num_people
int64

survey_num_people

timezone_id
enum {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480}

timezone_id

vertical
enum {NOT_SET, ADVERTISING, AUTOMOTIVE, CONSUMER_PACKAGED_GOODS, ECOMMERCE, EDUCATION, ENERGY_AND_UTILITIES, ENTERTAINMENT_AND_MEDIA, FINANCIAL_SERVICES, GAMING, GOVERNMENT_AND_POLITICS, MARKETING, ORGANIZATIONS_AND_ASSOCIATIONS, PROFESSIONAL_SERVICES, RETAIL, TECHNOLOGY, TELECOM, TRAVEL, NON_PROFIT, RESTAURANT, HEALTH, LUXURY, OTHER}

vertical

Obrigatório

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
name: string,
}

Error Codes

ErroDescrição
100Invalid parameter
3913It doesn't look like you have permission to create a new Business Manager.
200Permissions error
368The action attempted has been deemed abusive or is otherwise disallowed
3974The name you chose for this Business Manager is not valid. Try a different name.
3947You are trying to create a Business Manager with the same name as one you are already a part of. Please pick a different name.
102Session key invalid or no longer valid
3973The name you chose for this Business Manager is not valid. Please choose another.

Atualizando

Não é possível executar esta operação neste ponto de extremidade.

Excluindo

In order to delete a child Business Manager that has a line of credit, ensure that all ad accounts on it have been switched over to a different payment method in Business Manager. All prior monthly invoices must be fully paid, and the new payment method must be able to pay existing balances, if any.

You can dissociate a Business from a Business by making a DELETE request to /{business_id}/owned_businesses.

Parâmetros

ParâmetroDescrição
client_id
numeric string

client_id

Obrigatório

Return Type

Struct {
success: bool,
}

Error Codes

ErroDescrição
3912There was a technical issue and the changes you made to your Business Manager weren't saved. Please try again.
100Invalid parameter
200Permissions error

Error Codes

ErrorDescription

1752089

A User Can Only Create One Business Account At One Time

1690091

The name provided is not valid. Consider using {business_name} instead. Learn more about choosing a name.

1690090

The name you chose for this Business Manager is not valid. Please choose another. Learn more about choosing a name.

1690062

The name provided is already in use. Please choose a different name. Learn more about choosing a name.

1690111

Your payment account is disabled

1690138

To create a business using a primary page, you must be an admin of that page.

1690165

This aggregator business already has an existing client business associated with this user

1690232

Businesses Do Not Have Primary Pages: Please ensure all Business Managers have a unique Primary Page ID and try again.

1404163

Your Advertising Access is Restricted: You're no longer allowed to use Facebook Products to advertise. You can't run ads, manage advertising assets or create new ad or business accounts. Learn More

1404006

Sorry, this feature isn't available right now: An error occurred while processing this request. Please try again later.

1752089

Can Only Create One Business Account At One Time: A User Can Only Create One Business Account At One Time

2859040

Action not allowed: You are attempting to create a new Client Business Manager with a shared_page_id owned by a disallowed_business.

1690192

App is not owned or shared by a business: App must exist and be owned or shared to aggregator business to create client businesses