Search code examples
apipostmanfilemaker

API call works on postman but not on filemaker


I am trying to program an app in filemaker that uses data from an API service. The problem is that when I test an url using postman it returns the JSON file I want without problems, but when i use the insert from url command from Filemaker, the result is a 405 method not allowed error.

As additional information: I'm trying to get a JSON object from the API to a text field inside my Filemaker database, using a script to fill it up.

Here's the script I have in filemaker:

Insert from URL[Select; With Dialog: Off; Projects::JSONdata;

"https://soporte.adasoft.es/rest/api/2/search?jql=project=****&maxResults=10&fields=Id,key,status,name,startdate,details,lastupudated";

Curl Options:"-X GET" &
"-H 'Authorization: Basic
************'" &
"-H 'Cache-Control: no-cache'"]

OBSERVATIONS: I've replaced the sensible data (such as the encrypted simple authentication login) with '*'.


Solution

  • Try this

    Insert from URL[Select; With Dialog: Off; Projects::JSONdata;
    
    "https://soporte.adasoft.es/rest/api/2/search?jql=project=****&maxResults=10&fields=Id,key,status,name,startdate,details,lastupudated";
    
    cURL options:
    "-X GET" & "--header \"Authorization: Basic *******\"" & "--header \"Cache-Control: no-cache\""]
    

    Reference : https://fmhelp.filemaker.com/help/16/fmp/en/index.html#page/FMP_Help/insert-from-url.html