Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services AWS OpenApi 2.0使用Mturk 403错误_Amazon Web Services_Api_Swagger - Fatal编程技术网

Amazon web services AWS OpenApi 2.0使用Mturk 403错误

Amazon web services AWS OpenApi 2.0使用Mturk 403错误,amazon-web-services,api,swagger,Amazon Web Services,Api,Swagger,尝试在此处使用架构获取GetAccountBalance时出现403错误。问题可能在path元素上,因为Mturk文档中没有这方面的内容。我在AWS控制台中看到,请求是根据密钥使用更改日期识别的。我看到的某个地方 路径:“/#X-Amz-Target=MTurkRequesterServiceV20170117.AcceptQualificationRequest” 但不知道这是从哪里来的,也不知道是否适用于Mturk,因为Mturk有时似乎是其他AWS服务的一个异常值 { "

尝试在此处使用架构获取GetAccountBalance时出现403错误。问题可能在path元素上,因为Mturk文档中没有这方面的内容。我在AWS控制台中看到,请求是根据密钥使用更改日期识别的。我看到的某个地方

路径:“/#X-Amz-Target=MTurkRequesterServiceV20170117.AcceptQualificationRequest”

但不知道这是从哪里来的,也不知道是否适用于Mturk,因为Mturk有时似乎是其他AWS服务的一个异常值

{
    "swagger": "2.0",
    "info": {
        "description": "Amazon Mechanical Turk HIT API used for Salesforce External Services",
        "version": "1.0",
        "title": "Amazon Mechanical Turk",
        "termsOfService": "http://swagger.io/terms/"
    },
    "paths": {
        "/#X-Amz-Target=MTurkRequesterServiceV20170117.GetAccountBalance": {
            "post": {
                "summary": "Sends phone number for validation",
                "description": "Sends 10 digit US phone number to validate status, type of phone and carrier",
                "operationId": "GetAccountBalance",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "success",
                        "schema": {
                            "$ref": "#/definitions/success"
                        }
                    },
                    "403": {
                        "description": "Invalid input"
                    }
                }
            }
        }
    },
    "definitions": {
        "success": {
            "type": "object",
            "properties": {
                "AvailableBalance": {
                    "type": "number"
                }
            }
        }
    }
}

在这种情况下,邮递员需要添加到headers部分,尽管在这种情况下会自动添加headers

x-amz-target: MTurkRequesterServiceV20170117.GetAccountBalance
Content-Type: application/x-amz-json-1.1

你从哪里得到403个错误?例如,当测试来自Swagger UI或其他地方的请求时?在其他地方,Salesforce外部服务。鉴于我在AWS中看到了日期戳,尽管调用和凭证必须有效。起初我以为是这样,但现在我认为AWS不认可这项服务。我不太熟悉Postman和其他用于测试API的服务@Helen@Helen我试过邮递员,也犯了同样的错误。