This content from the SAP Concur Community was machine translated for your convenience. SAP does not provide any guarantee regarding the correctness or completeness of this machine translated text. View original text custom.banner_survey_translated_text
Hi,
I am new to SAP Concur Expense service. I am trying to close Payment Batches by calling the Concur API through my ASP.NET C# project. I am trying to do this in 3 steps by following the documentation (https://developer.concur.com/api-reference/expense/payment-batch/v1.payment-batches.html#closepaymen...
Sometimes, I face problems from step 2 (Close Payment Batch Synchronously). In this step, I don't get any successful response (response doesn't contain file URL), but the Payment Batch status changes and shows CLOSED. I can get SUCCESS status when I call the same API multiple times (2-10 times).
Following are the two ways I tried to perform step 2:
string url = "{UrlPrefix}/api/expense/paymentbatch/v1.1/batch/{batchId}/close"; Client = new HttpClient(); //HttpClient declared globally Client.DefaultRequestHeaders.Accept.Clear(); Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); Client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", {accessToken}); var body = new List<KeyValuePair<string, string>>(); HttpContent content = new FormUrlEncodedContent(body); HttpResponseMessage postResponse = await Client.PostAsync(url, content);
or,
string url = "{UrlPrefix}/api/expense/paymentbatch/v1.1/batch/{batchId}/close"; HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Post, url); requestMessage.Headers.Add("Authorization", "Bearer " + {accessToken}); requestMessage.Headers.Add("Accept", "application/json"); HttpResponseMessage postResponse = await Client.SendAsync(requestMessage); //HttpClient Client = new HttpClient() declared globally
In both scenarios, sometimes I get [postResponse.IsSuccessStatusCode = false] response. I tried to find the root cause of this problem but didn't find any.
If anyone has faced the same problem or knows any solution to the problem, please let me know.
This content from the SAP Concur Community was machine translated for your convenience. SAP does not provide any guarantee regarding the correctness or completeness of this machine translated text. View original text custom.banner_survey_translated_text
@MuhammadSakib I suggest posting this in the User Admin Group. This forum leans more towards end users and not site administrators. The User Admin Group is only site administrators that might have experience with your issue.
If you are not a member of the User Admin Group, go to the group and use the Request to Join link. You must have site admin permissions or be an Authorized Support Contact to be admitted into the group.