# C# or vb connect to OKTA API

**URL:** <https://devforum.okta.com/t/c-or-vb-connect-to-okta-api/15075>\
**Category:** Questions\
**Created:** [July 10, 2021, 11:12am UTC](https://devforum.okta.com/t/c-or-vb-connect-to-okta-api/15075 "2021-07-10T11:12:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![islwyn10](https://avatars.discourse-cdn.com/v4/letter/i/7ea924/32.png) [@islwyn10](https://devforum.okta.com/u/islwyn10)\
**Post date:** [July 10, 2021, 11:12am UTC](https://devforum.okta.com/t/c-or-vb-connect-to-okta-api/15075/1 "2021-07-10T11:12:49Z")

</div>

Hello,

How can I connect to the okta API using restful calls from a c# or vb program ?

Then I’d like to issue simple API retrival commands such as list users in a group.

By restful I also mean that I can’t bind in any OKTA nuget packages into my app or use the oktaclient object, it all has to be done from raw httpget and httppost

thanks  
Paul

---

<div class="post-metadata">

**Author:** ![phi1ipp](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@phi1ipp](https://devforum.okta.com/u/phi1ipp)\
**Post date:** [July 10, 2021, 4:52pm UTC](https://devforum.okta.com/t/c-or-vb-connect-to-okta-api/15075/2 "2021-07-10T16:52:04Z")

</div>

That’s probably a question to c# and VB forum, as all I see is you asking how to do HTTP get/post from your code. Please correct me if I’m wrong.

---

<div class="post-metadata">

**Author:** ![islwyn10](https://avatars.discourse-cdn.com/v4/letter/i/7ea924/32.png) [@islwyn10](https://devforum.okta.com/u/islwyn10)\
**Post date:** [July 11, 2021, 4:35pm UTC](https://devforum.okta.com/t/c-or-vb-connect-to-okta-api/15075/3 "2021-07-11T16:35:03Z")

</div>

I got there in the end. It’s so hard to find examples and so many examples are very complex. It was very simple in the end:

```auto
        Try

            Dim t As String = "my okta api key"

            Dim h As New http

            h.AddHeader("Authorization", "SSWS " & t)

            Dim s As String = h.HTTPGetNet("https://dev-xxx-admin.okta.com/api/v1/users", "application/json")

            Console.WriteLine(s)

            Console.ReadLine()

        Catch ex As Exception
            Console.WriteLine("error:" & ex.Message)
        End Try

```

http is a simple local class to do http gets, and could be replaced with webclient or whatever

---

<div class="post-metadata">

**Author:** ![phi1ipp](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@phi1ipp](https://devforum.okta.com/u/phi1ipp)\
**Post date:** [July 11, 2021, 4:48pm UTC](https://devforum.okta.com/t/c-or-vb-connect-to-okta-api/15075/4 "2021-07-11T16:48:34Z")

</div>

There you go! Well done! Now people can find your post and repeat or enhance your solution. Thank you for sharing 👍

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [July 12, 2021, 4:48pm UTC](https://devforum.okta.com/t/c-or-vb-connect-to-okta-api/15075/5 "2021-07-12T16:48:43Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
