public static string GetSignature(string apiCall, bool newTimestamp = false) { string timestamp; if (newTimestamp) { timestamp = GetNewTimestamp(); } else { timestamp = APISession.GetSessionTimestamp(); } string signature = GetMD5Hash(Credentials.DevId + apiCall + Credentials.AuthKey + timestamp); return(signature); }
public static string GetRequestURI(string apiCall, bool authParams = false, params string[] parameters) { string requestURI = $"{Endpoint}/{apiCall}Json"; if (authParams) { string sessionId = APISession.GetSessionId(); requestURI += $"/{Credentials.DevId}"; requestURI += $"/{GetSignature(apiCall)}"; requestURI += $"/{sessionId}"; requestURI += $"/{APISession.GetSessionTimestamp()}"; } foreach (var p in parameters) { requestURI += $"/{p}"; } return(requestURI); }