public SearchImageResponse SearchImages(SearchForImages2RequestBody searchBody, string token) { var requestHeader = new RequestHeader(); requestHeader.Token = token ?? string.Empty; var requestBody = new { RequestHeader = requestHeader, SearchForImages2RequestBody = searchBody }; var postData = JsonConvert.SerializeObject(requestBody); var responseBody = PostData("http://connect.gettyimages.com/v1/search/SearchForImages", postData); return JsonConvert.DeserializeObject<SearchImageResponse>(responseBody); }
public GetImageDetailsResponse GetImageDetail(GetImageDetailsRequestBody searchBody, string token) { var requestHeader = new RequestHeader(); requestHeader.Token = token ?? string.Empty; var requestBody = new { RequestHeader = requestHeader, GetImageDetailsRequestBody = searchBody }; var postData = JsonConvert.SerializeObject(requestBody); var responseBody = PostData("http://connect.gettyimages.com/v1/search/GetImageDetails", postData); return JsonConvert.DeserializeObject<GetImageDetailsResponse>(responseBody); }
public Response RenewSession(string token, string coordinationId, string systemId = "9999", string systemPassword = "******") { var requestHeader = new RequestHeader(); requestHeader.CoordinationId = coordinationId ?? string.Empty; requestHeader.Token = token ?? string.Empty; var renewSession = new RenewSessionToken(); renewSession.SystemId = systemId ?? string.Empty; renewSession.SystemPassword = systemPassword ?? string.Empty; var requestBody = new { RequestHeader = requestHeader, RenewSessionToken = renewSession }; var postData = JsonConvert.SerializeObject(requestBody); var responseBody = PostData("https://connect.gettyimages.com/v1/session/RenewSession", postData); return JsonConvert.DeserializeObject<Response>(responseBody); }
public Response CreateSession(string systemId = "9999", string systemPassword = "******", string userId = "userId", string userPassword = "******") { var requestHeader = new RequestHeader(); var sessionTokenRequest = new SessionTokenRequest(); sessionTokenRequest.SystemId = systemId; sessionTokenRequest.SystemPassword = systemPassword; sessionTokenRequest.UserName = userId; sessionTokenRequest.UserPassword = userPassword; var requestBody = new { RequestHeader = requestHeader, CreateSessionRequestBody = sessionTokenRequest }; var postData = JsonConvert.SerializeObject(requestBody); var responseBody = PostData("https://connect.gettyimages.com/v1/session/CreateSession", postData); return JsonConvert.DeserializeObject<Response>(responseBody); }