guides:ws_payloads_get_repository_file_names
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
guides:ws_payloads_get_repository_file_names [2020/08/23 16:58] – brett.zamora | guides:ws_payloads_get_repository_file_names [2022/03/29 17:22] (current) – brett.zamora | ||
---|---|---|---|
Line 36: | Line 36: | ||
{{tablelayout? | {{tablelayout? | ||
^ Column Name ^ Comparators ^ Allowed Values ^ | ^ Column Name ^ Comparators ^ Allowed Values ^ | ||
- | | FILE_NAME | Equals, Contains, StartsWith, EndsWith | Any string data. | | + | | FILE_NAME | Equal, Contains, StartsWith, EndsWith | Any string data. | |
- | | LOCK_STATUS | Equals | + | | LOCK_STATUS | Equal | Locked, Unlocked, All | |
- | | DATE_CREATED | Equals, Greater, GreaterEqual, | + | | DATE_CREATED | Equal, Greater, GreaterEqual, |
- | | DATE_MODIFIED | Equals, Greater, GreaterEqual, | + | | DATE_MODIFIED | Equal, Greater, GreaterEqual, |
Line 67: | Line 67: | ||
**Endpoint: | **Endpoint: | ||
- | < | + | < |
Line 125: | Line 125: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | |||
+ | **Comment 1:** | ||
+ | |||
+ | Following is a C# / .NET sample code snippet that shows how to call the payloads: | ||
+ | |||
+ | This snippet was derived from the [[guides: | ||
+ | |||
+ | |||
+ | <code C#> | ||
+ | private string[] getRepositoryFileNames(string strRepositoryName) | ||
+ | { | ||
+ | string[] strFileNames = null; | ||
+ | |||
+ | RestClient client = null; | ||
+ | RestRequest request = null; | ||
+ | IRestResponse response = null; | ||
+ | |||
+ | string strURL = " | ||
+ | |||
+ | // Password has to be hashed. | ||
+ | // New convention uses a Salt value from the user record | ||
+ | // See Login documentation for more details | ||
+ | |||
+ | string strSalt = GetSalt(tbUserName.Text); | ||
+ | string strPassword = tbPassword.Password.ToString(); | ||
+ | |||
+ | string strHashedPassword = HashPassword(strPassword, | ||
+ | |||
+ | string strParms = " | ||
+ | strParms += tbUserName.Text; | ||
+ | strParms += " | ||
+ | strParms += strHashedPassword; | ||
+ | strParms += " | ||
+ | |||
+ | client = new RestClient(strURL); | ||
+ | request = new RestRequest(Method.POST); | ||
+ | |||
+ | request.AddHeader(" | ||
+ | request.AddHeader(" | ||
+ | |||
+ | request.AddParameter(" | ||
+ | response = client.Execute(request); | ||
+ | |||
+ | if (response.IsSuccessful) | ||
+ | { | ||
+ | var jsonResult1 = JsonConvert.DeserializeObject< | ||
+ | string token = jsonResult1.access_token; | ||
+ | |||
+ | strURL = null; | ||
+ | client = null; | ||
+ | request = null; | ||
+ | response = null; | ||
+ | |||
+ | strURL = " | ||
+ | |||
+ | client = new RestClient(strURL); | ||
+ | request = new RestRequest(Method.GET); | ||
+ | |||
+ | request.AddHeader(" | ||
+ | request.AddHeader(" | ||
+ | response = client.Execute(request); | ||
+ | |||
+ | if (response.IsSuccessful) | ||
+ | { | ||
+ | JObject joResponse = JObject.Parse(response.Content); | ||
+ | JArray array = (JArray)joResponse[" | ||
+ | |||
+ | strFileNames = new string[array.Count]; | ||
+ | |||
+ | for (int i = 0; i < array.Count; | ||
+ | { | ||
+ | strFileNames[i] = (String)array[i][" | ||
+ | } | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | var jsonResult2 = JsonConvert.DeserializeObject< | ||
+ | string strMessage = jsonResult2.Exception.Message; | ||
+ | tbMessageLine.Text = strMessage; | ||
+ | } | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | var jsonResult2 = JsonConvert.DeserializeObject< | ||
+ | tbMessageLine.Text = jsonResult2.ToString(); | ||
+ | } | ||
+ | return (strFileNames); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | **Comment 2:** | ||
+ | |||
+ | A nice utility for experimenting with web service calls is POSTMAN. You can download a free version of POSTMAN from the following URL: https:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
guides/ws_payloads_get_repository_file_names.1598201891.txt.gz · Last modified: by brett.zamora