LoginSignup
0
0

Bad Request

Last updated at Posted at 2022-09-07

まとめページに戻る
まとめA~M

拡張ドメインの影響もある? 404の時は注意する

エラーコード別の例

400 Bad Request

The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing).

HyperText Transfer Protocol (HTTP) 400 Bad Request 応答ステータス コードは、クライアント エラーであると認識された何かが原因で、サーバーが要求を処理できない、または処理しないことを示します (たとえば、不正な形式の要求構文、無効な要求メッセージのフレーミング、または欺瞞的なもの)。リクエスト ルーティング)。

個別事例

Salesforce: Invalid response: Status code: 400 - {"error":"invalid_grant","error_description":"authentication failure"} (https://marketstar-hp-bdr.my.salesforce.com/services/oauth2/token) [Array ( [grant_type] => password [client_id] => 3MVG9kBt168mda_8tN7XVmdI70QPoFw1GtXQMWWCWZboZHweK0SDoYJlxS4AOYezIR9VGQdLKbzbjTfzXGsut [client_secret] => 6DED4C9EE1A41B4DB76EE93D35A5E4F20DA7FB9345C0F4483B7F42C7F7CCC790 [username] => bisupport.hpbdr@marketstar.com [password] => +MUl<?K)z=Z<%6p0tB%F6Cel800D4x000007rm3p8884x000002cNMcHTo5pVbyKXNra9AM3raG6xnR8BgsEblbrR78nhfSXTJE9KLDAtHo00MU7DtSKeKNmimAait ) ]

Bad request 400

The 400 (Bad Request) status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

400 (Bad Request) ステータス コードは、クライアント エラー (不正な形式のリクエスト構文、無効なリクエスト メッセージ フレーミング、不正なリクエスト ルーティングなど) が原因で、サーバーがリクエストを処理できない、または処理しないことを示します。

{"error":"invalid_grant","error_description":"authentication failure"}

How to get access token and refresh token for connected apps in salesforce


パラメータが違う

I had a mismatch in post variable name and parameter in the Rest service

https://salesforce.stackexchange.com/questions/123416/status-bad-request-statuscode-400-on-rest-api-call

Rest サービスのポスト変数名とパラメータが一致しませんでした

This issue can be marked resolved. Turns out that when going through those steps, you have to do them immediately in succession. I paused to read the instructions and then got pulled away for something at work. When I started the steps from the beginning and just went straight through, it worked.

この問題は解決済みとしてマークできます。これらの手順を実行するときは、すぐに連続して実行する必要があることがわかりました。私は指示を読むために一時停止しましたが、仕事中に何かのために引っ張られました。最初から手順を開始してまっすぐ進めたところ、うまくいきました。

I was passing folder Id in the double quote that's why I was getting errors. I got the answer, I passed the folder Id in a single quote then I was able to fetch the file.

フォルダー ID を二重引用符で囲んで渡していたため、エラーが発生していました。答えが得られ、フォルダー ID を一重引用符で囲んで渡すと、ファイルをフェッチできました。

try removing the base64 encoding and set the body directly with the requestBody string.

Also, uncomment the line where you set the 'Content-Type' header to 'multipart/form-data', because the endpoint still might need this to be able to correctly extract the payload.

base64 エンコーディングを削除し、requestBody 文字列を使用して本文を直接設定してみてください。

また、「Content-Type」ヘッダーを「multipart/form-data」に設定した行のコメントを解除します。これは、エンドポイントがペイロードを正しく抽出できるようにするためにこれが必要になる可能性があるためです。

401

{
"status": 401,
"message": "Salesforce failed to complete task: Message: This session is not valid for use with the REST API\r\nclientRequestId: XXXXXXXXXX",
"error": null,
"source": "Salesforce.Common",
"errors": []
}

This problem was associated with Salesforce Connected App Limits. Salesforce permits each user to grant access to a maximum of five connected apps at a time.

I had 6 accesses at the time.

Resolution: Review all the processes and ensure that no more than 5 access is used across salesforce connector in Azure.

https://help.salesforce.com/s/articleView?id=sf.ms_composer_salesforce_reference.htm&type=5

この問題は、Salesforce 接続アプリケーションの制限に関連していました。 Salesforce では、各ユーザが一度に最大 5 つの接続アプリケーションへのアクセスを許可できます。

その時点で6件のアクセスがありました。

解決策: すべてのプロセスを確認し、Azure の salesforce コネクタ間で使用されるアクセスが 5 つ以下であることを確認します。

406

"406 Not Acceptable: "[{"errorCode":"NOT_ACCEPTABLE","message":"Accept header specified in HTTP request is not supported: Application/Json, application/*+json"}]"]

429

503

Error received executing Salesforce Get; Caused by: com.boomi.util.retry.RetryException: com.boomi.model.connector.common.salesforce.SalesforceException: Error received for Salesforce Query; Caused by: Error received for Salesforce Query; Caused by: Error invoking soap operation; Caused by: The server sent HTTP status code 503: Service Unavailable

508

oas3

If the locator were invalid or improperly formatted, a 400 error would be returned.

I understood the problem and solved it. Because of the 6 hour rule, I had created another user to generate the spec for all the resources. So, I made the post request to create this spec with the new user token. In the request to get the specification, I was using the old user's token, which although valid, was not the user configured in the connected app. The older user had not access to the new generated spec, so the locator was invalid for that user (I guess). When I entered the new token I was able to get the specification.

問題を理解して解決しました。6 時間ルールのため、すべてのリソースの仕様を生成する別のユーザーを作成しました。そこで、新しいユーザー トークンを使用してこの仕様を作成するように投稿リクエストを行いました。仕様を取得する要求で、古いユーザーのトークンを使用していました。これは有効ですが、接続されたアプリケーションで構成されたユーザーではありませんでした。古いユーザーは新しく生成された仕様にアクセスできなかったため、ロケーターはそのユーザーには無効でした (推測)。新しいトークンを入力すると、仕様を取得できました。

302

HTTP/1.1 302 Found
拡張ドメインでSandboxのURLがmyがついていることが原因?

Error: 530003 (Azure)

This may happen with an environment which has been configured to use Edge to authennticate the device is a corporate owned.

The cause of the issue is that Salesforce app uses to SSO with build-in brower even if the device has configured to use Edge for a default browser.

これは、デバイスが企業所有であることを認証するために Edge を使用するように構成されている環境で発生する可能性があります。

この問題の原因は、デバイスがデフォルトのブラウザとして Edge を使用するように設定されている場合でも、Salesforce アプリケーションが組み込みブラウザで SSO を使用することです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0