No GetCompanyByExternalId

The .net client does not expose this method for Company. I have it working for Employee but need to figure out how to get a company from it’s external id. I am trying RestSharp but KeyPay docs do not show how to add the id parameter.

I’ve tried
internal void Run()
var client = SetupRestClient();

		var id = "a valid id";

		var request = new RestRequest("business/{externalid}", Method.GET).AddParameter("externalid", id);

		client.Authenticator = new RestSharp.Authenticators.HttpBasicAuthenticator(_apiKey, null);

		request.AddHeader("Content-type", "application/json");

		var response = client.Execute(request);

		var x = response.Content;

and various variations on this theme including
var request = new RestRequest(“business/our valid external id”, Method.GET).

Any pointers on how to get a business via External Company Id greatly appreciated. The .net client should really expose this method…

Hi Scott,

The url to get business details by external id is “business/externalid” so the line where you create your request was pretty much correct but just needs the {} chars removed:

var request = new RestRequest("business/externalid", Method.GET).AddParameter("externalid", id);

eg “business/externalid?externalid=id”

We will look to add this functionality to the .net client as soon as we can.


Nevermind, this works

		var request = new RestRequest("business/externalid", Method.GET).AddQueryParameter("externalid", id);