{"id":19101439,"url":"https://github.com/panoramicdata/ServiceNow.Api","last_synced_at":"2025-04-18T18:32:27.945Z","repository":{"id":37995164,"uuid":"186248798","full_name":"panoramicdata/ServiceNow.Api","owner":"panoramicdata","description":"ServiceNow REST API nuget package","archived":false,"fork":false,"pushed_at":"2024-08-13T09:31:48.000Z","size":31589,"stargazers_count":21,"open_issues_count":13,"forks_count":18,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-13T14:15:43.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/panoramicdata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-12T11:54:47.000Z","updated_at":"2024-09-02T20:44:28.000Z","dependencies_parsed_at":"2024-08-12T19:45:52.409Z","dependency_job_id":"4524eca1-406d-40d5-ac2e-b14a780b501f","html_url":"https://github.com/panoramicdata/ServiceNow.Api","commit_stats":{"total_commits":75,"total_committers":8,"mean_commits":9.375,"dds":0.5066666666666666,"last_synced_commit":"1adb46abddfd28255b09e6cecf9c121fec5cd4ab"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoramicdata%2FServiceNow.Api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoramicdata%2FServiceNow.Api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoramicdata%2FServiceNow.Api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoramicdata%2FServiceNow.Api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panoramicdata","download_url":"https://codeload.github.com/panoramicdata/ServiceNow.Api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223783088,"owners_count":17201906,"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-11-09T03:53:17.740Z","updated_at":"2025-04-18T18:32:27.938Z","avatar_url":"https://github.com/panoramicdata.png","language":"C#","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"# ServiceNow.Api\n\n[![Nuget](https://img.shields.io/nuget/v/ServiceNow.Api)](https://www.nuget.org/packages/ServiceNow.Api/)\n[![Nuget](https://img.shields.io/nuget/dt/ServiceNow.Api)](https://www.nuget.org/packages/ServiceNow.Api/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/24dcf171dd8540a192635ed46eeb1ea3)](https://www.codacy.com/gh/panoramicdata/ServiceNow.Api/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=panoramicdata/ServiceNow.Api\u0026amp;utm_campaign=Badge_Grade)\n\n# Usage\n\nTo create a simple command line app that uses the ServiceNow REST API:\n\n1. Create a .NET Core 7.0 Console project in Visual Studio\n2. Ensure that you have specified \u0026lt;LangVersion\u0026gt;latest\u0026lt;/LangVersion\u0026gt; in the csproj file, e.g.:\n```` xml\n\u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n\n\t\u003cPropertyGroup\u003e\n\t\t\u003cOutputType\u003eExe\u003c/OutputType\u003e\n\t\t\u003cTargetFramework\u003enet7.0\u003c/TargetFramework\u003e\n\t\t\u003cLangVersion\u003elatest\u003c/LangVersion\u003e\n\t\t\u003cNullable\u003eenable\u003c/Nullable\u003e\n\t\t\u003cAnalysisMode\u003eRecommended\u003c/AnalysisMode\u003e\n\t\t\u003cAnalysisLevel\u003elatest-recommended\u003c/AnalysisLevel\u003e\n\t\u003c/PropertyGroup\u003e\n\n\t\u003cItemGroup\u003e\n\t\t\u003cFolder Include=\"Properties\\\" /\u003e\n\t\u003c/ItemGroup\u003e\n\n\t\u003cItemGroup\u003e\n\t\t\u003cPackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.1\" /\u003e\n\t\t\u003cPackageReference Include=\"ServiceNow.Api\" Version=\"1.2.*\" /\u003e\n\t\u003c/ItemGroup\u003e\n\n\u003c/Project\u003e\n\n````\n3. Edit Program.cs to be similar to the following:\n\n```` C#\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing System.Runtime.Serialization;\n\nnamespace ServiceNow.Api.Example;\n\npublic static class Program\n{\n\tpublic async static Task Main(string[] args)\n\t{\n\t\tvar account = args[0];\n\t\tvar username = args[1];\n\t\tvar password = args[2];\n\n\t\tConsole.WriteLine(\"Lists Windows Servers\");\n\n\t\tusing var serviceNowClient = new ServiceNowClient(account, username, password, new Options());\n\n\t\t// MANDATORY: The table name can be obtained from this list:\n\t\t// https://docs.servicenow.com/bundle/london-platform-administration/page/administer/reference-pages/reference/r_TablesAndClasses.html\n\t\tconst string tableName = \"cmdb_ci_win_server\";\n\n\t\t// OPTIONAL: The main sysparm_query goes here.  See documentation here:\n\t\t// https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/integrate/inbound_rest/reference/r_TableAPI-GET.html\n\t\t// If you omit this, an unfiltered result will be returned\n\t\tconst string query = \"name\";\n\n\t\t// OPTIONAL: The fields to bring back.\n\t\t// This should be set to constrain the response to ONLY the fields that you are going to process.\n\t\t// Doing so will hugely speed up your query.\n\t\tvar fields = new List\u003cstring\u003e { \"sys_id\", \"name\" };\n\n\t\tvar jObjectResults = await serviceNowClient.GetAllByQueryAsync(\n\t\t\ttableName,\n\t\t\tquery,\n\t\t\tfields\n\t\t\t).ConfigureAwait(false);\n\n\t\tvar modelResults = jObjectResults.ConvertAll(o =\u003e o.ToObject\u003cWinServerModel\u003e());\n\n\t\tConsole.WriteLine(\"Windows Servers:\");\n\t\tforeach (var modelResult in modelResults)\n\t\t{\n\t\t\tConsole.WriteLine($\"  - {modelResult.Id}: {modelResult.Name}\");\n\t\t}\n\t}\n}\n\n[DataContract]\npublic class WinServerModel\n{\n\t[DataMember(Name = \"sys_id\")]\n\tpublic string Id { get; set; }\n\n\t[DataMember(Name = \"name\")]\n\tpublic string Name { get; set; }\n}\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanoramicdata%2FServiceNow.Api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanoramicdata%2FServiceNow.Api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanoramicdata%2FServiceNow.Api/lists"}