https:
Postman Request
Authorization :
Token Name : Token 10,
Auth URL : https:
Access Token URL : https:
Client ID : ABCD,
Client Secret : xyz,
Grant Type : Client Credentials,
Headers -
User-Agent : QBOV3-OAuth2-Postman-Collection,
Accept : application/json,
Content-Type : application/json,
Authorization : bearer token,
Body :
{
"Name": "A 10",
"AccountType": "Accounts Receivable"
}
Response :
{
"Fault": {
"Error": [
{
"Message": "An application error has occurred while processing your request",
"Detail": "System Failure Error: null",
"code": "10000"
}
],
"type": "SystemFault"
},
"time": "2020-06-29T18:01:30.262-07:00"
}
var client = new RestClient("https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer");
var request = new RestRequest(Method.POST);
request.AddParameter("application/x-www-form-urlencoded", "grant_type=client_credentials&client_id=" + ClientID + "&client_secret=" + ClientSecret + "&redirect_uri=" + RedirectUrl + "&authorization_endpoint=https://appcenter.intuit.com/connect/oauth2", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
TokenResponse tokenresponse = javaScriptSerializer.Deserialize<TokenResponse>(response.Content);
var clients = new RestClient("https://sandbox-quickbooks.api.intuit.com/v3/company/9620826365047887210/query?minorversion=51");
var requests = new RestRequest(Method.POST);
requests.AddHeader("user-agent", "QBOV3-OAuth2-Postman-Collection");
requests.AddHeader("content-type", "application/json");
requests.AddHeader("accept", "application/json");
requests.AddHeader("cache-control", "no-cache");
requests.AddHeader("authorization", tokenresponse.token_type+" "+tokenresponse.access_token);
requests.AddParameter("application/json", "{\r\n \"Name\": \"A 12\", \r\n \"AccountType\": \"Accounts Receivable\"\r\n}", ParameterType.RequestBody);
IRestResponse responses = clients.Execute(requests);
What I have tried:
for this we have to create account on intuit url : https: