Jump to content

Help with API


This topic is 2642 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi. I am trying to script the getting of some data from a website that has an API. I have BaseElementsPlugin and was given an example bit of code by the website:

 data = {'domain': domain, 'include_generic': True}

            headers = {'X-Api-Key': 'xyz123'}

            resp = requests.post('https://api.anymailfinder.com/v3.0/search/domain.json', data=data, headers=headers)

I have never dealt with this kind of programming and am not even sure where this info would go or what script step(s) I would use to call this. Is this CURL? Are you aware of sample FM scripting that I could use as a model to figure this out?

Thanks for any help with this!

Link to comment
Share on other sites

That example does not look  how you would use the BE plugin to make API calls...

In FM it would look something like this; where $_json is the data that you want to send.

You would have as many of the "set custom headers" as you need, their API will tell you what you need.

 

 

2017-01-29_07-16-12.png

This is assuming that the API requires an HTTP POST.  If the API requires only HTTP GET then it would like different.

  • Like 1
Link to comment
Share on other sites

This topic is 2642 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.