Dim 网址 As String="http://www.foxtable.com/bbs/?code=84b20aab348e4a73a4f57d30554d8e01711b9017&state=1212"
Dim code() As String = 网址 .split("=")
'Output.Show(code(1) )
Dim ID As String="7dd1dd0e66874d4387336f5689afbabf"
Dim secret As String="4571a199849bde9eede72f26c1f8bd2030e9db2c"
Dim hcat As new HttpClient("http://open-api.pinduoduo.com/oauth/token")
hcat.C
Dim jo As New JObject
jo("grant_type") = "authorization_code"
jo("code") = code(1).Replace("&state","")
jo("client_id" )= ID
jo("client_secret")=secret
hcat.Content = jo.tostring
'output.Show(hcat.GetData)
Dim jo1 As JObject = JObject.Parse(hcat.GetData)
If jo1("error_response") IsNot Nothing Then
Output.Show(jo1("error_response")("error_msg").Tostring) '错误
End If
If jo1("access_token") IsNot Nothing Then
Output.Show(jo1("access_token").Tostring) 'access_token获取
Dim token As String = jo1("access_token").Tostring
Dim _Type As String="JSON"
Dim timestamp As String = CInt((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000)
Dim 拼接 As String= secret & "access_token" & token & "client_id" & ID & "data_type" & _Type & "order_status1page1page_size10timestamp" & timestamp & "typepdd.order.number.list.get" & secret
Output.Show ( 拼接 )
Dim MD5结果 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(拼接 , "MD5")
Output.Show ( MD5结果 )
Dim access_token As String = jo1("access_token").Tostring
Dim 接口名称 As String = "pdd.order.number.List.increment.get"
Dim hc订单 As new HttpClient("https://gw-api.pinduoduo.com/api/router")
hc订单 .C '
hc订单.FormData.Add("refund_status", "1")
hc订单 .FormData.Add("type","pdd.order.number.list.get")
hc订单 .FormData.Add("client_id",ID)
hc订单 .FormData.Add("access_token",token )
hc订单 .FormData.Add("timestamp" , timestamp )
hc订单 .FormData.Add("data_type","JSON")
hc订单 .FormData.Add("sign",MD5结果 )
hc订单 .FormData.Add("is_lucky_flag","0")
hc订单 .FormData.Add("order_status","1")
hc订单.FormData.Add("start_updated_at","1571187628")
hc订单.FormData.Add("end_updated_at","1571189427")
hc订单 .FormData.Add("page","1")
hc订单 .FormData.Add("page_size","10")
hc订单 .FormData.Add("trade_type","0")
hc订单 .FormData.Add("use_has_next","true")
output.Show(hc订单.GetData)
End If
打印结果
935194951cc9476195da1c7877cc335f8eb27ef5
4571a199849bde9eede72f26c1f8bd2030e9db2caccess_token935194951cc9476195da1c7877cc335f8eb27ef5client_id7dd1dd0e66874d4387336f5689afbabfdata_typeJSONorder_status1page1page_size10timestamp1573273388typepdd.order.number.list.get4571a199849bde9eede72f26c1f8bd2030e9db2c
D1C8E4C97CE3C84783937698C8EF5AE7
{"error_response":{"error_msg":"签名验证失败","sub_msg":"签名验证失败","sub_code":"20004","error_code":20004,"request_id":"15732733899372105"}}
哪里有错?