LoginSignup
keikioomomo
@keikioomomo (圭喜 大桃)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

Salesforce ApexでGoogle Apps Script APIを呼び出しGASを実行しようとしたらRequested entity was not foundエラー表示

Salesforce ApexにGoogleのスクリプトにアクセスする処理を実装しています。
そこで、処理を実行時した際にエラーとなるのですが、
どこを確認すれば良いのかわからず困っています。
ご教示いただければ幸いです。

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

code=404, message=Requested entity was not found., status=NOT_FOUND

Apexソースコード

Http http = new Http();
HttpRequest req = new HttpRequest();

String reqPath = 'callout:google_scriptapi';
req.setEndpoint(reqPath);
req.setMethod('POST');
req.setHeader('content-type', 'application/json');
JSONGenerator gen = JSON.createGenerator(true);
gen.writeStartObject();
gen.writeStringField('function', 'testFunc');
gen.writeStringField('devMode','true');
gen.writeEndObject();
String reqBody = gen.getAsString();
req.setBody(reqBody);
HttpResponse res = http.send(req);
Map results = (Map) JSON.deserializeUntyped(res.getBody());
System.debug(results);

※上記エラー内容は、下から1行目、 System.debug(results); でのエラー内容です。

指定ログイン情報:google_scriptapiの設定内容

表示ラベル google_scriptapi
名前 google_scriptapi
URL https://script.googleapis.com/v1/scripts/*************:run
証明書
ID 種別 指定ユーザ
認証プロトコル OAuth 2.0
認証プロバイダ google_open
範囲 https://www.googleapis.com/auth/script.scriptapp
認証状況 認証済み

認証プロバイダ:google_openの設定内容

認証プロバイダ ID ************
プロバイダタイプ Open ID Connect
名前 google_open
URL 接尾辞 google_open
コンシューマ鍵 ******
コンシューマの秘密 ******
承認エンドポイント URL https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force
トークンエンドポイント URL https://oauth2.googleapis.com/token
デフォルトの範囲 https://www.googleapis.com/auth/script.scriptapp

何卒宜しくお願いいたします。

0

No Answers yet.

Your answer might help someone💌