YouTube API v3 - keyInvalid Error 400 - PHP

时间:2017-09-02 12:07:23

标签: php youtube-data-api

如果我尝试获取频道的所有视频,我总是会收到此错误。

case 'POST_TODO_FULFILLED':
      return { 
          ...state, 
          loading: false, 
          data: {...state.data, ...action.playload.response.data},
          added: true
      }

我的代码如下

let array = ["one","two","three","one"]
var newArray:Array<String> = []

for obj in array {
 if newArray.contains(obj) {
    print(newArray)
}else {
    newArray.append(obj)
}
}

我在intro(3)上创建了一个项目并添加,激活了&#34; YouTube Data API v3&#34;,用#34; Webserver(例如Node.js,Tomcat)创建了凭据&#34 ;作为平台,最后在我的php文件中复制了密钥。我不知道为什么我无法让它发挥作用。我很感激帮助。 :)

修改

使用Webbrowser(JavaScript)作为平台,它应该可以工作。

2 个答案:

答案 0 :(得分:0)

if
if

注意:您需要一个虚拟服务器来运行php(wamp / mamp / xampp)

答案 1 :(得分:0)

使用Dim dMaxDate AS Date, wsForLoop AS Worksheet, sTestString AS String dMaxDate = DateSerial(1900,1,0) 'Default to 0 For Each wsForLoop In ThisWorkbook.Worksheets 'Loop through every worksheet sTestString = wsForLoop.Name 'Get the name of the sheet If InStr(sTestString, " ") > 0 Then sTestString = Mid(sTestString, 1+InStr(sTestString, " ")) 'Remove the Weekday 'If you need to add the Month/Year from your filename, do that here If IsDate(sTestString) Then 'Only check Worksheets with Dates for Names If cDate(sTestString) > dMaxDate Then dMaxDate = cDate(sTestString) 'If this is a later date then store it End If Next wsForLoop 'Return to start of loop If dMaxDate < DateSerial(1900, 1, 1) Then dMaxDate = Now-1 'If we have no Worksheets with Dates for Names then default to yesterday With ThisWorkbook.Worksheets.Add 'Add a new sheet 'Change the Format if you are adding the Month and/or Year from Filename .Name = Format(dMaxDate+1, "ddd d mmm") 'And Name it the day after our stored date End With 作为平台,它应该有效。