我希望将shuttlecloud用于来自服务的导入联系人。当我尝试如此处所述的请求时,我会收到回复
{"错误":{" msg":"缺少参数:时间戳"," id":" 400&# 34;}}
这里是我的代码:
my $ua = LWP::UserAgent->new;
my $url = 'https://demo.api.shuttlecloud.com/beta/load';
my $appid = 'some_app_id';
my $ts = int(time);
my $secret = 'some_secret';
my $sig = sha256_hex("{".$appid.":".$secret.":".$ts."}");
my $data = '{
"userid": {
"email": "admin@gypost.com"
}
}';
my $json = decode_json($data);
$url = $url."?appid=".$appid."&ts=".$ts."&sig=".$sig.;
my $req = HTTP::Request->new(POST => $url);
$req->content($json);
my $resp = $ua->request($req);
my $res = $resp->decoded_content;
print "Resp $res\n";
我做错了什么?