@wagateee (itsuki wagatsuma)

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

【{"success": 0, "options": {"err": "Not Authorized" } }】APIのエラー

解決したいこと

Talentioという人事システムのAPIを叩きたい

公式の出しているドキュメントは↓
https://developers.talentio.com/
参考にした記事は↓
https://qiita.com/tbpgr/items/da9b3122ef38c6cff298

発生している問題・エラー

{"success":0,"options":{"err":"Not Authorized"}}

image.png

該当するソースコード

function myFunction() {
  var url = "https://talentio.com/api/v1/candidates"
  var token = "****************"
  try{
    var r = UrlFetchApp.fetch(
      url
      ,{
        'method':"get"
        ,headers:
          {'Authorization':'Bearer '+token
          ,'Content-Type':'application/json'}
        ,"muteHttpExceptions" : true
      }
      )
    console.log(r.getContentText())
    }catch(e){
      console.log(e.getContent())

      }
}

自分で試したこと

ここに問題・エラーに対して試したことを記載してください。
CURLコマンドを叩いてみても同じような結果に
image.png

0 likes

2Answer

Comments

Your answer might help someone💌