Last active
April 19, 2018 10:44
-
-
Save sniffdk/4deaa996ce8dc21f958c34a44df3537f to your computer and use it in GitHub Desktop.
OST poc create user request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static string baseUrl = "https://playgroundapi.ost.com"; | |
private static string key = "xxx"; | |
var name = "apiuser"; | |
var timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(); | |
var request = $"/users/create?api_key={key}&name={name}&request_timestamp={timestamp}"; | |
var signature = Sign(request); | |
var values = new Dictionary<string, string> | |
{ | |
{ "api_key", key }, | |
{ "name", name }, | |
{ "request_timestamp", timestamp }, | |
{ "signature", signature } | |
}; | |
var url = $"{baseUrl}{request}&signature={signature}"; | |
var content = new FormUrlEncodedContent(values); | |
var response = await client.PostAsync(url, content); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static string baseUrl = "https://playgroundapi.ost.com"; | |
private static string apiKey = "xxx"; | |
var name = "Test User"; | |
var timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(); | |
var endpoint = $"/users/create"; | |
var signature = Sign(apiKey, timestamp); | |
var values = new Dictionary<string, string> | |
{ | |
{ "name", name }, | |
{ "signature", signature } | |
}; | |
var url = $"{BaseUrl}{request}"; | |
var content = new FormUrlEncodedContent(values); | |
var response = await Client.PostAsync(url, content); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment