CodeIgniter Forums
Using third party REST API, how to? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Using third party REST API, how to? (/showthread.php?tid=67622)



Using third party REST API, how to? - mr_pablo - 03-16-2017

I am working on a project that involves connecting to a third party REST API.

I'm struggling to find a way to connect, as the few CI libraries I have found are either too old, have no proper documentation, are in French, or a mix of all the above!

I need to be able to set the URL endpoint, set a few headers (the REST API expects two API keys with specific names) and at times, request content (e.g. for POST calls)

What are my options in terms of a CI library?

I have tried the following, with zero luck (typically the documentation just doesn't explain much/the code is old and abandoned or deprecated)

https://github.com/philsturgeon/codeigniter-restclient
https://github.com/maltyxx/restclient


RE: Using third party REST API, how to? - ivantcholakov - 03-16-2017

In this project of mine you can find several clients installed, there are quick tests too:
https://github.com/ivantcholakov/codeigniter-restserver-test

Lately I tend to prefer this client https://github.com/php-http/httplug , http://httplug.io and here is a sample test: http://iridadesign.com/codeigniter-restserver-test/php-http-client-test But you see the other clients and examples before you decide what best fits to you.