Skip to content

17. Client Link Api

Vincent Kok edited this page Dec 4, 2023 · 1 revision

Create a client link

Link a new organization to your OAuth application, in effect creating a new client.

var request = new ClientLinkRequest
{
	Owner = new ClientLinkOwner
	{
		Email = "[email protected]",
		GivenName = "Chuck",
		FamilyName = "Norris",
		Locale = "en_US"
	},
	Address = new AddressObject()
	{
		StreetAndNumber = "Keizersgracht 126",
		PostalCode = "1015 CW",
		City = "Amsterdam",
		Country = "NL"
	},
	Name = "Mollie B.V.",
	RegistrationNumber = "30204462",
	VatNumber = "NL815839091B01"
};
using IClientLinkClient client = new ClientLinkClient({yourClientId}, {yourClientSecret});
ClientLinkResponse response = await clientLinkClient.CreateClientLinkAsync(request);

Generate the client link URL

To the ClientLink link you created through the API, you can then add the OAuth details of your application, the client_id, scope you want to request

using IClientLinkClient client = new ClientLinkClient({yourClientId}, {yourClientSecret});
ClientLinkResponse response = await clientLinkClient.CreateClientLinkAsync(request);
var clientLinkUrl = response.Links.ClientLink;
string result = clientLinkClient.GenerateClientLinkWithParameters(clientLinkUrl, {yourState}, {yourScope}, {forceApprovalPrompt});
Clone this wiki locally