We want to set up a single application to process webhooks for different companies in IN. We can configure the single webhooks for all the applications. But when we receive a request for clients from different company its failing because IN url is different for different companies. So, we want to know how can we figure out the company and url of the company based on the client field from the webhook request. Once we have url for the company, we can call clients API using url for the specific company.
If the requesting URL/HOST is different, you should be able to inspect the request itself and harvest the URL… in laravel there is a helper $request->getHost() which can provide this information. If you are not using laravel, you’ll want to find the corresponding global that can provide that information.
Another way to achieve the same outcome is to append the company to the webhook URL…
ie. if your webhook URL is
/admin/webhook
Then for each company, just make the webhook URL
/admin/webhook/company1
/admin/webhook/company2
You can then use the URI segment to determine the requesting company.
It returns the details about the server which is processing the request. We are actually looking for the IN company url (for ex. https://fg-test.invoicing.co/ or https://fg-uat.invoicing.co/) that is triggering the request. Any API or pointers that will get us the IN company url ?
when you define the API endpoint in the subscription, you can add any metadata you require to resolve the company that is calling this request, no?
ie. company 1
domain/api/endpoint/company1
company 2
domain/api/endpoint/company2
Within your API endpoint you can determine the URI segment (or you can even use query parameter ?company=xxxx) or am I missing some piece of information?