Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

theUnforgiven's avatar

How best to use external API

Hi all, This will sound like a total, random question, but just looking for some advice on how you guys would approach this.

I'm trying to work with the following API - https://developer.duedil.com/docs/pro but having followed he docs through and coded to an interface, I get null returned.

I have contacted Duedil about this to see if they can help but I thought I'd ask the Laravel community to advise how best to do this. All i want to do is search for a company by name and/or company number, send that request to Duedil for them to return back a JSON response so I can use it as I wish.

0 likes
6 replies
deadlockgB's avatar

You could for testing purposes and on how to form the requests use a plugin for your browser like HttpRequester for Firefox

theUnforgiven's avatar

Yes I will do that, just not sure I have built this right to interact with the API as NULL is been returned every time.

theUnforgiven's avatar

I'm actually looking for the best way to write the API into my Laravel app in order to get this to work the way I want. If anyone could advise best way, i've coded to an interface to start with is this best practice?

theUnforgiven's avatar

Am i going to need something like Guzzle to get the URL request that will return it to JSON?

deadlockgB's avatar

you should get a response upon what you requested if on their endeverything is well. So if you send a request with application/json as the content type you can expect to get jso back.

Did you set your API/Sanbox API correctly in the request?

http://duedil.io/v3/uk/companies/06999618?api_key=KEY

You need to set the KEY with the API key you got from DueDil. The key must be set in every request as an URL parameter as per documentation: https://developer.duedil.com/docs/pro#api-key

alexr's avatar

Hi all! I see the thread is actually 2 years old but still if people are interested there is new DueDil API v4. I am technical lead in the API here at DueDil and just wanted to share the new developments and possibly help with any technical questions.

Here is the documentation page https://www.duedil.com/api/docs it's brand new API and we've worked hard to make it easy to integrate and user-friendly. It's based on Swagger Specification (OpenAPI) which allows easy integration with many languages and frameworks. If you want to test the API you could use Postman (https://www.getpostman.com/) which will allow you to import the JSON spec (https://duedil.io/v4/swagger.json) and send HTTP requests to the API.

Also here is another good resource a Swagger generator for Laravel projects https://github.com/weburnit/swagger-generator

If you have any further question on integration I'd be more than happy to help.

Please or to participate in this conversation.