# Accessing the API from Visual Studio

**URL:** <http://forum.companieshouse.gov.uk/t/accessing-the-api-from-visual-studio/1752>\
**Category:** API Question\
**Created:** [April 9, 2018, 4:32pm UTC](http://forum.companieshouse.gov.uk/t/accessing-the-api-from-visual-studio/1752 "2018-04-09T16:32:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![graeme\_webster](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/g/91b2a8/32.png) [@graeme\_webster](http://forum.companieshouse.gov.uk/u/graeme_webster)\
**Post date:** [April 9, 2018, 4:32pm UTC](http://forum.companieshouse.gov.uk/t/accessing-the-api-from-visual-studio/1752/1 "2018-04-09T16:32:31Z")

</div>

Hello

I’m trying to setup a service reference within Visual Studio to write code against the API.  
The last time I worked with web services a few years ago I entered a WSDL url in order to generate all the methods within visual studio.  
I’ve tried entering the companies house api url in the service details. I get prompted for credentials but it doesn’t accept my key  
Can anyone advise if I’m going about this the right way?

Many thanks

---

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [April 10, 2018, 12:23pm UTC](http://forum.companieshouse.gov.uk/t/accessing-the-api-from-visual-studio/1752/2 "2018-04-10T12:23:00Z")

</div>

**Caveat: I don’t use Visual Studio and I’m just another forum user**

Short: there currently isn’t a WSDL file for this API that I know of, or indeed any automatically discoverable specification. (Anyone who does know of one please post!) So it’s [read the documentation](https://developer.companieshouse.gov.uk/api/docs/) and build it yourself. The documentation has errors (search forum) but the [Authorisation documents](https://developer.companieshouse.gov.uk/api/docs/index/gettingStarted/apikey_authorisation.html) work plus there are plenty of examples for various languages searchable on this forum.

Longer: some time ago (early 2016) CH advised that they used [Swagger](https://swagger.io/) - at least for generating the CH documentation. This would be the equivalent of WSDL - I believe it’s now termed the [Open API Specification (OAS)](https://swagger.io/specification/). CH never released their spec. Intentions to do so were mentioned in:  
[http://forum.aws.chdev.org/t/swagger-specification/471](http://forum.aws.chdev.org/t/swagger-specification/471)  
There was another mention in 2017, but nothing since, and the documentation doesn’t seem to be updated:  
[http://forum.aws.chdev.org/t/swagger-specifications-for-ch-api/924](http://forum.aws.chdev.org/t/swagger-specifications-for-ch-api/924)

If this were available you could probably use Swagger’s Codegen tool to create stub code for the service. There are about 40 language generators listed for [Swagger Codegen](https://swagger.io/docs/swagger-tools/#installation-11) including c++, C#, C#.NET etc.

I’m sure people are rolling their own (OAS) for parts of CH, and we may eventually run their process in reverse e.g. CH documentation → (patch errors) → Swagger / OAS.

An alternative route would be to go down the XML / SOAP path with the (subscription-based) XML API (Companies House Gateway). I presume there’s the full WSDL etc. There’s an overview at [About our services - Companies House - GOV.UK](https://www.gov.uk/government/organisations/companies-house/about-our-services#xmlgw-info), documentation at [http://xmlgw.companieshouse.gov.uk/](http://xmlgw.companieshouse.gov.uk/) and a forum at [http://xmlforum.aws.chdev.org/](http://xmlforum.aws.chdev.org/)

Hope this helps,  
Chris
