---
title: 'yahoo dsp api'
disqus: hackmd
---
###### tags: `yahoo dsp api`
yahoo dsp api
===
[TOC]
## API的一些特性
1. 關了就再也找不到了 client secret client id

About Access Tokens¶
DSP Uses the OAuth2 client_credentials workflow and identifies the client using a JSON Web Token to generate the access token. Complete the following two steps to the access token using the client ID and secret.
## yahoo oauth
### 1.Obtain OAuth 2.0 Authentication Credentials¶
The first step towards gaining access to the |api|s is to obtain authentication credentials (client ID, client secret, and authorization code) for your YDN app.
First, you must request access to the DSP APIs and OAuth support from your account manager (external users) or product support (internal users).
Once you have the appropriate permissions, you can sign up on the Yahoo Developer Network (YDN), create a YDN app, and request the authentication credentials from the YDN. The YDN authorization server generates the authentication credentials that will enable you to generate the access tokens that will enable your YDN app to use the |api|s.
This is a one-time process. For step-by-step instructions, see Obtain OAuth Credentials (YDN).
### 2.Generate OAuth 2.0 Access Tokens¶
Once you have the authentication credentials for your YDN app, your client application can request an access token and refresh token from the YDN authorization server.
These OAuth tokens will enable your application to access the Yahoo DSP API in all subsequent requests. The access token is a temporal credential that enables the YDN app to make requests. The refresh token is a persistent credential that enables the YDN app to generate new access tokens.
This is a one-time process. For step-by-step instructions, see Generate OAuth Tokens (YDN).
### 3.Refresh OAuth 2.0 Access Tokens¶
The lifetime of an access token is limited to one hour.
If your YDN app needs to access a Yahoo DSP API beyond the lifetime of a single access token, it can generate a new access token using its refresh token.
For step-by-step instructions, see Refresh YDN Access Token.
### 4.Using the Access Token¶
Include the value of your fresh access_token in the X-Auth-Token header of each request made to the Yahoo DSP API.
For more information, see Authorization Code Flow for Server-side Apps on Yahoo! Developer Network.
## 目前進度:
已經拿到了
clientID:
clientsecret:
也知道如何拿到code:
將這段網址貼在瀏覽器上
https://api.login.yahoo.com/oauth2/request_auth?client_id=dj0yJmk9VE1ZV0dIU281dldnJmQ9WVdrOVptUlVlR3Q1YlRFbWNHbzlNQT09JnM9Y29uc3VtZXJzZWNyZXQmc3Y9MCZ4PWIx&redirect_uri=oob&response_type=code&language=en-us
之後用 eng.yadapi@yahoo.com 去登入
它就會跳出code的頁面


## 參考文件
1. [Generate OAuth Tokens (YDN)](https://developer.yahooinc.com/dsp/api/docs/authentication/tokens.html#generate-oauth-tokens-ydn)
2. [DSP Authentication](https://developer.yahooinc.com/dsp/api/docs/authentication/vmdn-auth-overview.html)
3. [YDN Authentication Overview](https://developer.yahoo.com/dsp/api/docs/authentication/auth-overview.html)