Jump to content
DeathRobot

Help with API

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!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • By Richard Carlton
      We have a new fix for Google Maps in FMSP & the FMI Contacts Starter Solution
      Vid 1 - Getting your API Key:

      Vid 2 - FMI Contacts Starter Solution Fix

      Vid 3 - FMSP Fix

      Get up to speed with the FileMaker Video Training Course!
      FileMaker is a cross-platform relational database application from FileMaker Inc. https://en.wikipedia.org/wiki/FileMaker
      Top Rated Course by FileMaker Expert, Richard Carlton.
      http://learningfilemaker.com/fmpro17.php
      Customer relationship management, processes implemented to manage a company's interactions with customers and prospects
      https://en.wikipedia.org/wiki/CRM
      Experience Richard's dynamic and exciting teaching format, while learning both basic, intermediate, and advanced FileMaker development skills. With 26 years of FileMaker experience and a long time speaker at FileMaker's Developer Conference, Richard will teach you all the ins and outs of building FileMaker Solutions.
      The course is 50 hours of video content!
      Richard has been involved with the FileMaker platform since 1990 and has grown RCC into one of the largest top tier FileMaker consultancies worldwide.
      Richard works closely with RCC's staff: a team of 28 FileMaker developers and supporting web designers.
      He has offices in California, Nevada, and Texas.
      Richard has been a frequent speaker at the FileMaker Developers Conference on a variety of topics involving FileMaker for Startups and Entrepreneurs, and client-server integration.
      Richard is the Product Manager for FM Starting Point, the popular and most downloaded free FileMaker CRM Starter Solution.
      Looking for FM Starting Point free software download: http://www.fmstartingpoint.com
      Richard won 2015 Excellence Award from FileMaker Inc (Apple Inc) for outstanding video and product creation, leading to business development.
      RCC, Filemaker Videos, and LearningFileMaker.com are headquartered in Santa Clara, CA.
      http://www.rcconsulting.com/
      Contact us at support@rcconsulting.com
      FileMaker Pro is simply a powerful software used to create custom apps that work seamlessly across iPad, iPhone, Windows, Mac, and the web
      Transform your business with the FileMaker Platform
      https://sites.google.com/site/filemakerprotrainingd2n/home/filemaker-training
      Free FileMaker Training Videos Channel https://www.youtube.com/user/FileMakerVideos
      FileMaker Training -FileMaker Video Training Course-FileMaker News-FileMaker Experts
      https://www.youtube.com/watch?v=RO3Do8QIQOE
      https://www.youtube.com/watch?v=RO3Do8QIQOE&index=2&list=PLjTvUZtwtgBTWVT38kPvgjCfkZmMmvCOk&t=25s
      FileMaker What's New-Top Ten Things To Know About FileMaker -FileMaker News
      https://youtu.be/6ZcnQEOF9XE
      https://www.youtube.com/watch?v=6ZcnQEOF9XE&index=1&list=PLjTvUZtwtgBTWVT38kPvgjCfkZmMmvCOk&t=25s
      Sharing a FileMaker Solution-The Basics-Sharing FileMaker Database-FileMaker Experts
      https://youtu.be/a5o5Mt8DnFI
      https://www.youtube.com/watch?v=a5o5Mt8DnFI&index=9&list=PLjTvUZtwtgBQukMafXx60CF5rcXwNmGWl&t=0s
      A database management system (DBMS) is a computer software application that interacts with the user, other applications, and the database itself to capture and analyze data
      Official site SDK, Developer's Guide, Reference, and Android Market for the open source project
      http://learningfilemaker.com/FIAS.html
      Video introduction to iOS App Training https://www.youtube.com/watch?v=cVxQe_yAshw
      Free FileMaker videos check out ...http://www.filemakervideos.com
      Download the FileMaker Pro & FileMaker GO for mobile devices training videos at http://www.learningfilemaker.com
      Download FileMaker Go video training at http://learningfilemaker.com/FMGO-17/index.php
      Download FileMaker Full Video Training Bundle at http://learningfilemaker.com/subscription.php
      Learn how to use FileMaker to create an app with the FileMaker Training Series
      Comment, Like & Share All of Our Videos.
      Feel Free to Embed any of Our Videos on Your Blog or Website.
      Follow Us on Your Favorite Social Media
      Facebook
      Twitter
      Google+
      #FileMakerGoogleMaps
      #FileMakerAPI
      #FileMakerGoogleMapsAPI
      #FileMakerFreeVideoTraining
      #FileMakerTrainingVideos
      #FilemakerProTraining
      #FileMakerVideoTutorial
      #FileMakerProVideos
    • By Franco Pagano
      when inserturl do not have a response it freeze and wait, then i tried using curl : --connect-timeout 1
      but it doesn work.
      please how to interupt the execution on inserturl command at e specific time.
       
      testcurl.fmp12
    • By jayivan
      I am working on an API integration from FileMaker 17 to Emma. Generally when I work on a new API, I get the curl working on the command line and then translate that into FM. But I've hit a roadblock with one particular API call while my other API calls to Emma are successful. (In the example below, I substituted out sensitive data with all caps.)
      From the command line, the code is:
      curl -u USER:PASS -H "Accept:application/json" -H "Content-type: application/json" -X POST -d '{"fields": {"name_first": "TESTFIRST","name_last": "TESTLAST","eligible": "false","expiration": "@D:2019-06-30"},"group_ids": ["GROUPIDNUMBER"],"email": "EMAIL@EMAIL.COM","opt_in_confirmation": "false"}' "https://api.e2ma.net/ACCOUNTNUMBER/members/signup"
      This command is successful.  The server responds with the individuals' emma id and group confirmation. 
      This fails using Insert from URL within FM though. While eventually I'll use FileMaker fields for an individual record's names, email, and expiration dates, I did not use fields in my testing in order to duplicate the command line exactly. In Insert from URL:
      The URL is "https://api.e2ma.net/ACCOUNTNUMBER/members/signup"
      The curl option is "-u USER:PASS -H \"Accept:application/json\" -H \"Content-type: application/json\" -X POST -d '{\"fields\": {\"name_first\": \"TESTFIRST\",\"name_last\": \"TESTLAST\",\"eligible\": \"false\",\"expiration\": \"@D:2101-06-30\"},\"group_ids\": [\"GROUPIDNUMBER\"],\"email\": \"EMAIL@EMAIL.COM\",\"opt_in_confirmation\": \"false\"}'"
       
      Can anyone identify the problem or suggest a workaround? My experience with API integration with FM is limited, but anything I could get working via the command line, I've been able to get working within FM until this.
    • By Osman
      hello all,
      I am using insert from url script step in my server scheduled script with cURL parameters.
      Insert from URL step gives error 1, user cancelled action.
      I have added  --max-time 30 option, but still same error code.
      I changed the url to any regular web page, it works. But it still not works with orginal url (mailgun api url).
      how can I handle this problem?
      regards,
      osman
       
    • By Richard Carlton
      In this Coaches' Corner tip, Richard Carlton challenges you to go learn how to use RESTful services!
      Get up to speed with the FileMaker Pro 16 Video Training Course! 
      Top Rated Course by FileMaker Expert, Richard Carlton.  
      http://learningfilemaker.com/fmpro16.php
      Experience Richard's dynamic and exciting teaching format, while learning both basic, intermediate, and advanced FileMaker development skills. With 27 years of FileMaker experience and a long time speaker at FileMaker's Developer Conference, Richard will teach you all the ins and outs of building FileMaker Solutions.  The course is 50 hours of video content!
      Richard has been involved with the FileMaker platform since 1990 and has grown RCC into one of the largest top tier FileMaker consultancies worldwide. 
      Richard works closely with RCC's staff: a team of 28 FileMaker 
      developers and supporting web designers. He has offices in California, Nevada, and Texas.

      Richard has been a frequent speaker at the FileMaker Developers Conference on a variety of topics involving 
      FileMaker for Startups and Entrepreneurs, and client server integration.

      Richard is the Product Manager for FM Starting Point, the popular and most downloaded free FileMaker CRM Starter Solution.

      Richard won 2015 Excellence Award from FileMaker Inc (Apple Inc) for outstanding video and product creation, leading to business development.

      RCC and LearningFileMaker.com are headquartered in Santa Clara, CA.

      http://www.rcconsulting.com/
      Please feel free to contact us at support@rcconsulting.com
      If you want to explore building iOS apps for iPhone or iPad and deploying those out to the Apple App Store.
       
      Here is a video introduction to our iOS App Training https://www.youtube.com/watch?v=cVxQe_yAshw
      Looking for FM Starting Point free software download: http://www.fmstartingpoint.com
      For More Free FileMaker Videos Check out http://www.filemakerfree.com
      Visit http://www.learningfilemaker.com for all facets of FileMaker Award Winning Video Training.
      Please Visit Our Channel: https://www.youtube.com/user/FileMakerVideos Please Subscribe While There.

      Please Comment, Like & Share All of Our Videos.

      Feel Free to Embed any of Our Videos on Your Blog or Website.
      Follow Us on Your Favorite Social Media
      https://www.facebook.com/FileMakerVideos
      https://twitter.com/filemakervideos
      https://plus.google.com/+FileMakerVideos/videos

      Filemaker Pro 16 Training Videos
      FileMaker 16 Videos
      Filemaker Pro 16 Video Course
      #FileMakerVideos
      #FileMakerTrainingVideos
      #WhatisFilemaker16
      #FilemakerPro16Training
      #Filemaker16VideoTutorial
      #FilemakerPro16Videos
×

Important Information

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