Skip to content

Commit 4d6f13a

Browse files
authored
Update AppTokenCSharpExample.cs
1 parent 198678e commit 4d6f13a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

C#/AppTokenCSharpExample/AppTokenCSharpExample.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,21 @@ public static async Task<HttpResponseMessage> GetApplicantStatus(string applican
121121
return response;
122122
}
123123

124-
public static async Task<HttpResponseMessage> GetAccessToken(string applicantId, string levelName)
124+
public static async Task<HttpResponseMessage> GetAccessToken(string externalUserId, string levelName)
125+
126+
var body = new
127+
{
128+
userId = externalUserId,
129+
levelName = levelName
130+
};
131+
132+
// Create the request body
133+
var requestBody = new HttpRequestMessage(HttpMethod.Post, SUMSUB_TEST_BASE_URL)
134+
{
135+
Content = new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json")
136+
};
125137
{
126-
var response = await SendPost($"/resources/accessTokens?userId={applicantId}&levelName={levelName}", new HttpRequestMessage());
138+
var response = await SendPost($"/resources/accessTokens/sdk", requestBody);
127139
return response;
128140
}
129141

0 commit comments

Comments
 (0)