{"id":23532467,"url":"https://github.com/kth/ug-rest-api-helper","last_synced_at":"2026-01-08T19:50:57.196Z","repository":{"id":44830677,"uuid":"512882031","full_name":"KTH/ug-rest-api-helper","owner":"KTH","description":"Hold helper functions to retrive data from UG Rest Api","archived":false,"fork":false,"pushed_at":"2024-08-02T04:22:17.000Z","size":1269,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-31T21:33:19.962Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KTH.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-11T19:19:38.000Z","updated_at":"2024-05-11T08:21:19.000Z","dependencies_parsed_at":"2024-10-11T07:41:05.847Z","dependency_job_id":null,"html_url":"https://github.com/KTH/ug-rest-api-helper","commit_stats":{"total_commits":81,"total_committers":2,"mean_commits":40.5,"dds":0.03703703703703709,"last_synced_commit":"3225bf333d533e793616ebfd3cbc7262388309f4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fug-rest-api-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fug-rest-api-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fug-rest-api-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fug-rest-api-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KTH","download_url":"https://codeload.github.com/KTH/ug-rest-api-helper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246837684,"owners_count":20841903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-25T23:10:47.252Z","updated_at":"2026-01-08T19:50:57.153Z","avatar_url":"https://github.com/KTH.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ug-rest-api-helper\nHold helper functions to retrive data from UG Rest Api\n\n# Agenda UG Rest Api Helper\nThis project has the implementation of calling UG rest API. It will fetch users and groups data.\n\n# Passing Connection Properties\nUG rest Api requires authentication token to send back data. For that, need to pass few connection parameters first to make sure that there will be no un-authorized response issue during fetching time of UG data set.\nIn `ugRestApiHelper` , connection properties needs to be set using `initConnectionProperties` method and in that method following parameters need to pass.\n1. `authorityURL` needs to pass to get access token. Make sure the url should be without `/oauth2/token`.\n2. `clientId` needs to pass to get access token.\n3. `clientSecret` needs to pass to get access token.\n4. `ugURL` needs to pass. This will be used while fetching UG data.\n5. `subscriptionKey` needs to pass. (Optional)\n\nNote: Make sure `ugURL` is correct and authenticates the `subscriptionKey` that is passed.\n\nIf token is not expired then Api will use existing token to fetch the data otherwise it will generate a new token.\n\n# Fetch UG Data\nThere are two data set supported so far.\n1. Users\n2. Groups\n\n# Fetch UG Groups\nFor groups to fetch there are two methods added.\n\n1. getUGGroups\n This method will receive `groupFilterAttributeName` which indicates property name like 'name', 'kthid' etc, `operatorToUseInFilter` like 'eq', 'contains', 'startswith' etc, `groupFilterAttributeValue` like 'sst' (this will be the filter value to filter out the data) and there is a flag `expandMembers`. If this set to true then it will fetch groups along with members.\n\n2. getUGGroupsByGroupName\n This method will bring groups along with members if needed. There is a flag `expandMembers`. If this set to true then it will fetch groups along with members. `groupName` needs to pass because filter will preapplied to 'name' only. `operatorToUseInFilter` also needed that how data should filter.\n\n# Fetch UG Users\nFor user to fetch there is one method.\n1. getUGUsers\nThis method will receive `userFilterAttributeName` which indicates property name like 'givenName', 'kthid' etc, `operatorToUseInFilter` like 'eq', 'contains', 'startswith' etc, `userFilterAttributeValue` like 'Joakim' (this will be the filter value to filter out the data).\n\n# Operators supported so far\nThere are few filter operators that are supported so far.\n1. eq\n2. startswith\n3. contains\n4. in\n\nUse on of these operators to filter out data.\n\nTODO: There are other operators as well that is supported by UG Rest Api. Those will be including in the future.\n\nCheck the link below to see what are the supported filter by UG.\n\nhttps://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752358\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fug-rest-api-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkth%2Fug-rest-api-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fug-rest-api-helper/lists"}