News for Developers

Back to News

Marketing API Setup 101

Kefei Lei
November 1, 2018

We're continually looking for ways to navigate through complex systems for our advertisers and developer communities. To make the API journey feel less complicated and more user friendly, we've created a Marketing API Setup 101 to share with your clients, especially for those using our APIs for the first time.

What is the Marketing API?

Introduction to the Marketing API video


Who should read this?

An admin of your Business Manager, who also manages your Facebook API projects. The admin should use the Facebook accounts that they log in to their Business Manager to complete the steps below.

Note: We recommend that you don't create fake, temporary accounts. You can manage the ownership of your Facebook App and other assets later in Business Manager; don't worry about your business assets being tied to a single person.

Key Concepts

  • Facebook Apps. Facebook Apps integrate Facebook's News Feed, Notifications, various social channels and other features to generate awareness and interest in the app by Facebook users. All API access needs to be backed by a Facebook App. In this sense, a Facebook App is really just an ID registered with Facebook. Note: This is not necessarily an actual app in app store. To start with, it's simply an ID you register with Facebook. You can later link this ID to an actual app, or use it as a stand-alone entity to access the API.

  • System User. A system user is a person who interacts with a system, typically through an interface, to extract some functional benefit. You can create a non-human user in Business Manager to represent the entity who accesses the API, so that it's not tied to a real person. This is the recommended way of accessing the API. Learn more about Business Manager System User.

  • Access Token. An access token is an opaque string that identifies a user, app, or page. The app can use an access token to make graph API calls. Access tokens are obtained via a number of methods. The token includes information about when the token will expire and which app generated the token. Because of privacy checks, all API calls need to be authenticated with an access token. You need the “password” to access the API. There are different types of access tokens to support different use cases.

How to Generate an Access Token for Access to the Facebook API

Note: Only complete the following in your Business Manager if you have no system users under UsersSystem Users. If you already have a system user, skip to step 5.

Step 1: Create a Facebook App.

You may need to first convert your Facebook account into a developer account. Copy the app ID of your newly created app.

Step 2: Claim your App in Business Manager.

Go to Business SettingsAccountsApps+AddAdd an AppPaste your App ID. After your App is claimed by your Business Manager, you can manage its access/ownership in Business Manager as long as you are an admin of the Business Manager.

Step 3: Create a system user.

Go to UsersSystem Users+Add, select Regular System Users for System User Role, and give it a name.

Step 4: Add your newly created system user as an admin of your App.

This generates an access token that's linked to both. Go to AccountsApps and select your newly added AppAssign PeopleAssign the System User as admin.

Step 5: Assign your assets (ad accounts, catalogs, or offline event sets) to your system user.

The system user can only access assets assigned to it. For instance, to use the API to upload offline conversions, you need to assign an admin role to your system user on the offline event set. Go to UsersSystem Users → select your system userAssign Assets.

Step 6: Give your developer access to related business assets in Business Manager.

Step 7: Generate an access token.

Go to UsersSystem Users → select your system userGenerate New Token → select your newly created App → check the applicable permissions (permissions depend on which API you want to access, but generally the following are most often used: ads_management, read_insights, ads_read). Click Generate Token.

Step 8: Store the token securely and treat it as a password.

Give this token to your developer to start accessing Facebook's API.

Learn more about a Business Manager System User.

Need more help?

Note: Special mention also to Trevor Tessalone, Client Services Manager, for insight and feedback.


Related News

December 18 2018

November 27 2018

October 25 2018

October 23 2018

September 27 2018

July 31 2018