Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Latest commit

 

History

History
49 lines (25 loc) · 2.12 KB

BingAds-Auth.md

File metadata and controls

49 lines (25 loc) · 2.12 KB

BingAds API SDK (Authentication Guide)

Note: These steps were tested as of June 3rd, 2021, you may need modify these steps to work for your specific project.

This uses the BingAds-PHP-SDK for the Bing Ads API

(1) API Access

You need access before you can use the API, follow the links below to help you gain access.

Create Developer Token

Help Guide – Quick Start

Help Guide - Get a Developer Token

(2) Register Your Application

Bing Requires you to register your app. This is where you get your client id and client secret.

  1. Register Your Application (Azure)

  2. Supported account types: select "Accounts in any organizational directory (Any Azure AD directory - Multitenant)"

  3. Redirect URI: Web type, then add https://login.microsoftonline.com/common/oauth2/nativeclient

  4. Fill in .env BING_CLIENT_ID with the "Application (client) ID" from the overview page for your app

  5. Go to Certificates & secrets and create a new secret

  6. Copy the "value" of this new secret into the .env BING_CLIENT_SECRET (not the secret ID)

(3) Generate Refresh Token

Run php artisan laravelads:token:generate --service=BingAds

  1. Copy and go to the URL shown after running that command

  2. It will ask you to login and "approve access" to your application

  3. You will be redirected to a URL, most likely a white page. COPY the url from in the address bar and paste it into the command line.

  4. Copy and paste the refresh token you see into .env BING_REFRESH_TOKEN

Back to Readme

Sandbox

The Bing Ads API Sandbox can be used by changing the API environment using the ->setEnvironment('Sandbox') method.