0% found this document useful (0 votes)
15 views2 pages

API

Uploaded by

umar fayyaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

API

Uploaded by

umar fayyaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

app.

MapPost("/GetDirectUser", [Authorize] async (HttpContext httpContext) =>


{
try
{
var requestModel = await
[Link]<RequestModel>();
var client = new HttpClient();
[Link]("Accept", "application/json, text/plain,
*/*");
[Link]("Accept-Language", "en-US,en;q=0.9");
[Link]("Referer",
"[Link]
[Link]("User-Agent", "Mozilla/5.0 (Windows NT
10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/[Link]
Safari/537.36");
[Link]("languageId", "2");

var response =
[Link]("[Link]
guest/login").Result;
var json = [Link]().Result;
var jsonObject = [Link](json);

[Link]("userToken",
jsonObject["userToken"]?.ToString());
[Link]("refreshToken",
jsonObject["refreshToken"]?.ToString());
[Link]("CURRENT_PORTAL", "ICA");
var country = [Link]().Where(x => [Link] ==
[Link]()).FirstOrDefault();
int coId = 0;
if (country != null)
{
coId = [Link];
}
var requestData = new
{
request = new
{
IdentificationType = 1,
FileModuleId = 2,
PersonUnifiedNumber = [Link],
CurrentNationalityId = coId,
DateOfBirth = [Link],
ApplicantMobile = "00971555555555",
ApplicantEmail = "a@[Link]"
},
ServiceTransactionId = "588",
AdministrativeRegionId = "1",
WithException = false,
CurrentStep = "leavePermitRequest.step2",
RequestNumber = "0001226715442025510506745",
Id = 211633950
};
var jsonContent = new StringContent([Link](requestData),
Encoding.UTF8, "application/json");
var response2 = await
[Link]("[Link]
draft/add", jsonContent);

var json2 = [Link]().Result;

var leavePermitRequest =
[Link]<LeavePermitRequest>(json2, new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
});
return [Link];
}
catch (Exception ex)
{
throw new Exception("Something went wrong...");
}
});

You might also like