Google API - URL Shortener with PHP

后端 未结 8 2010
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-02 12:24

My code is below. The URL shortening service works, but it doesn\'t when I insert my $POST. Does anyone know how to fix this my looking at the code?



        
8条回答
  •  失恋的感觉
    2021-02-02 12:56

    You have a key, but you are not using it correctly

    You should append it to the url, don't send the key in the post

    https://www.googleapis.com/urlshortener/v1/url?key='.$apiKey
    

    Please check https://developers.google.com/url-shortener/v1/url/insert

提交回复
热议问题