(An update to the JS Fiddle function and the Clay function that explains this when we update the syntax of the function to clear)
I packaged the Github @ mark-fasel package mentioned below in the Clay microservice, which allows you to do just that:
Simplified return format: https://www.clay.run/services/nicoslepicos/medium-get-user-posts-new/code
I put together a little fiddle, as the user asked how to use the endpoint in HTML to get the headers for the last 3 posts: https://jsfiddle.net/h405m3ma/3/
You can call the API as follows:
curl -i -H "Content-Type: application/json" -X POST -d '{"username":"nicolaerusan"}' https://clay.run/services/nicoslepicos/medium-get-users-posts-simple
You can also easily use it in your node code using the npm package for clay-client and just write:
Clay.run('nicoslepicos/medium-get-user-posts-new', {"profile":"profileValue"}) .then((result) => { // Do what you want with returned result console.log(result); }) .catch((error) => { console.log(error); });
Hope this is helpful!
source share