Skip to content

Instantly share code, notes, and snippets.

@sniffdk
Last active April 19, 2018 10:44
Show Gist options
  • Save sniffdk/4deaa996ce8dc21f958c34a44df3537f to your computer and use it in GitHub Desktop.
Save sniffdk/4deaa996ce8dc21f958c34a44df3537f to your computer and use it in GitHub Desktop.
OST poc create user request
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);
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