0

I work on a django website. Currently, I need to integrate it with a third-party API that provides only PHP endpoints and some shitty documentation that instructs how to build PHP requests. The API provider introduces a PHP client containing a class that handles requests to PHP API webservice via SOAP.

First, is it possible to build python client that will interact with PHP endpoints without knowing server-side trickery of the API provider? Should I dive deeper into PHP client source code and try to rewrite it in python?

Second, should I create intermediary PHP webservice that will integrate third-party PHP API and provide a precise API to interact with python client.

Is there any better option?

P.S. Please, note that I'm new to PHP and SOAP.

bilbohhh
  • 693
  • 1
  • 6
  • 16
  • What do you mean with "PHP endpoints"? Can you describe it a bit more precise? – Twinfriends Jun 26 '17 at 08:55
  • Documentation of the API provider suggests to validate credentials selecting "php endpoint" in the connection tester at their website. User may choose between "php endpoint" and ".net endpoint". Probably, it is their idiosyncrasy. To be more precise, the provider have only a documentation how to integrate their api with PHP. As far as I know, API endpoints should return standardized data in JSON or XML format. Can endpoints contain any language-specific logic? – bilbohhh Jun 26 '17 at 09:46
  • 1
    Normally you can call request an API in the language you want... Would be new for me that there are API's that can only be accessed trought a specific language. – Twinfriends Jun 26 '17 at 09:47

1 Answers1

1

Just like any other API. You just have to use the PHP client as a guide to build the API client in python. If you feel it's no help at all, throw it away and look what the endpoints are and what they spit out.

In the end, the endpoints on the remote server can be programmed in Smalltalk for you care. The API client only cares about what parameters to send to the server and what the response looks like.

So pick your basics:

and start coding ;) Good luck!