- Python Programming Blueprints
- Daniel Furtado Marcus Pennington
- 279字
- 2021-06-24 18:53:48
Creating a configuration file
Let's go ahead and create a file called config.yaml in the musicterminal directory with the following contents:
client_id: '<your client ID>'
client_secret: '<your client secret>'
access_token_url: 'https://accounts.spotify.com/api/token'
auth_url: 'http://accounts.spotify.com/authorize'
api_version: 'v1'
api_url: 'https://api.spotify.com'
auth_method: 'AUTHORIZATION_CODE'
client_id and client_secret are the keys that were created for us when we created the Spotify application. These keys will be used to get an access token that we will have to acquire every time we need to send a new request to Spotify's REST API. Just replace the <your client ID> and <your client secret> with your own keys.
After the client_id and client_secret keys, we have the access_token_url. This is the URL to the API endpoint that we have to perform requests on in order to get the access token.
auth_url is the endpoint of Spotify's Account Service; we will use it when we need to acquire or refresh an authorization token.
The api_version, as the name says, specifies Spotify's REST API version. This is appended to the URL when performing requests.
Lastly, we have the api_url, which is the base URL for Spotify's REST API endpoints.
- 重新定義Spring Cloud實(shí)戰(zhàn)
- 互聯(lián)網(wǎng)基礎(chǔ)資源技術(shù)與應(yīng)用發(fā)展態(tài)勢(shì)(2021—2023)
- 正在爆發(fā)的互聯(lián)網(wǎng)革命
- PLC、現(xiàn)場總線及工業(yè)網(wǎng)絡(luò)實(shí)用技術(shù)速成
- 網(wǎng)絡(luò)安全技術(shù)與解決方案(修訂版)
- 5G技術(shù)與標(biāo)準(zhǔn)
- TD-LTE無線網(wǎng)絡(luò)規(guī)劃與設(shè)計(jì)
- INSTANT LinkedIn Customization How-to
- 轉(zhuǎn)化:提升網(wǎng)站流量和轉(zhuǎn)化率的技巧
- 新媒體交互藝術(shù)
- 計(jì)算機(jī)通信網(wǎng)絡(luò)安全
- OSPF協(xié)議原理與功能拓展
- 物聯(lián)網(wǎng)傳感器技術(shù)與應(yīng)用
- 巧學(xué)活用CISCO網(wǎng)絡(luò)典型配置
- Microsoft System Center 2012 Configuration Manager:Administration Cookbook