Set-up a HTTP RPC-style webservice

0
Hi there, We are using Teamleader as our CRM system. I've developed an application in Mendix, which I want to interact with Teamleader using their API.  I've already set-up another API (Chamber of Commerce), but the Teamleader API works a little bit different, not a REST service but a HTTP RPC-style method. Documentation about their API can be found here. I want to use both POST and GET functionality.  Is there anyone who can help by explaining what are the first steps to take in Mendix? Thanks in advance!
asked
3 answers
0

There is no real technical difference between HTTP-RPC and REST. Both use HTTP protocol, with HTTP actions on URLS, with usually JSON messages.

This means that Mendix REST can be used out-of-the-box for HTTP-RPC. It could also be called a HTTP-RPC client, only reason it's not called this way is that HTTP-RPC is not very popular anymore.

So, what is the difference between REST and HTTP-RPC when it's not technical? It's a best practice: the URL in REST normally refer to data, where as the URL in HTTP-RPC normally refers to an action.

For example:

* To get contract 1 in REST => GET http://localhost/api/contracts/1

* To get contract 1 in HTTP-RPC => GET http://localhost/api/getcontract?contract_id=1  or something similar.

Anyway, the REST consume functionality in Mendix doesn't really care if your URL points to data or a remote procedure (RPC).

 

 

answered
2

Check out https://docs.mendix.com/refguide/consumed-rest-services about consuming a rest service, see also the tutorial video with it!

answered
1

The documentation seems straightforward. Did you follow this learning path? https://gettingstarted.mendixcloud.com/link/path/33

[EDIT]

I have misread the part about RPC. There is a github project that might be usefull: https://github.com/gk-brown/HTTP-RPC/blob/master/README.md

But you might run into more problems: https://stackoverflow.com/questions/3641724/why-is-rpc-over-http-a-secutity-problem

My assumption might be wrong but RPC seems to be on the way out and might not even work in a Mendix environment.

Regards,

Ronald

 

answered