亚马逊AWS Connect中找不到资源异常

时间:2018-10-05 05:23:50

标签: amazon-web-services aws-sdk-go amazon-connect

我正在尝试通过Amazon Connect从我的go程序中启动出站呼叫,但是我找不到资源异常,即:

ResourceNotFoundException:未找到具有提供的参数值的资源:InstanceId     状态码:404,请求ID:dxxxxxxxxxxxxxxxxx

package main

import (
"github.com/aws/aws-sdk-go/service/connect"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws"
"fmt"
)

func main() {

sess, err := session.NewSession(&aws.Config{
    Region:      aws.String("us-west-2"),
    Credentials: credentials.NewStaticCredentials("xxxxxxxxxxx", 
     "xxxxxxxxxxxxxxx","")})
svc := connect.New(sess)

var sub connect.StartOutboundVoiceContactInput
sub.SetContactFlowId("cexxxx-0xx8-xxxx-a2b5-0885xxxxx91")
sub.SetInstanceId("24xxxxxc-319b-xxxx-a850-xxxxxxxxxxxx")
sub.SetDestinationPhoneNumber("+181xxxxxxxx")
sub.SetSourcePhoneNumber("+181xxxxxxxx")
sub.SetQueueId("f5xxxx-xxxx-xxxxx-xxxx-xxxxxxx")

req, resp := svc.StartOutboundVoiceContact(&sub)

if err == nil { // resp is now filled
    fmt.Println(resp)
}else{
    fmt.Println(req)
}


}

但是当我在aws cli上尝试相同的操作时,我得到了成功的答复。任何人都可以帮我吗,请提前谢谢...

0 个答案:

没有答案