asp.net - square connect api obtain token error -
I have successfully acquired the code from the class from OAuth authorization. But I can not use it to get a token to exchange. I get this response:
{"message": "missing parameter 'client_id`", "type": "bad_request"} my ASP The .net implementation is the following:
object = new {client_id = [app_id], client_secret = [app_secret], code = [authCode]}; JavaScriptSerializer serializer = new JavaScriptSerializer (); Var json = serializer.Serialize (item); HttpContent content = new string content (Jason, System.text encoding.Utf 8, "Application / JSN"); Var httpclient = new HTTP client (); HttpClient.BaseAddress = New Uri ("https://connect.squareup.com"); Authentication header value auth = new authentication header value ("authorization", "client [ap_cent]"); HttpClient.DefaultRequestHeaders.Authorization = auth; HttpClient.DefaultRequestHeaders.Accept.Add (New MediaTypeWithQualityHeaderValue ("App / Jason")); Task & LT; HttpResponseMessage & gt; HttpResponse = httpCLient.PostAsync ("/ oauth2 / token", content); If (httpResponse.Result.StatusCode! = HttpStatusCode.OK) {} string result Resource = httpResponse.Result.Content.ReadAsStringAsync (). result; I got stuck at this point Why not find that it says that the client_id parameter is missing, although I send this parameter.
resolve solution issue:
Comments
Post a Comment