Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Greetings,

I am attempting to post data to an API. This is the sample from the company:

curl -X POST "https://123456" -H  "accept: text/plain" -H  "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEwMjQiLCJ1bmlxdWVfbmFtZSI6IkdyYWluIFNjYWxlIFRlc3QiLCJTZXJ2ZXJOYW1lIjoiREVWVEVTVDUiLCJEYXRhYmFzZU5hbWUiOiJURVNUUExBWSIsInJvbGUiOlsiV3JpdGUiLCJHcmFpblNjYWxlIl0sIm5iZiI6MTY4MDIyODE1MywiZXhwIjoxNjgwMzE0NTUzLCJpYXQiOjE2ODAyMjgxNTN9.yhqi6tMddjt7xyFj1tV4pzJkAPIcpf_hTJtyrH8mrwc" 
-H  "Content-Type: application/json" -d 
"{\"JobID\":\"string\",\"TicketID\":\"string\",\"LocationID\":0,\"CustID\":0,\"GradeID\":0,\"ElevatorReceiptNo\":\"string\",\"LoadID\":\"string\",\"ScaleGrossWeight\":0,\"ScaleTareWeight\":0,\"ScaleNetWeight\":0,\"Dockage\":0,\"CarrierID\":0,\"OrderNumber\":\"string\",\"Comments\":\"string\",\"ScaleTicketGradingFactors\":[{\"GradingFactorID\":0,\"GradingFactorValue\":0}]}"

The FileMaker JSON array that I built is formatted differently.  Primarily missing all the back slashes and missing the data types. Is there a workaround for this, or am I doing something wrong?

JSONSetElement ( "{}" ; 

    [ "JobID" ;  Shipping Scale Ticket::JobID  ; JSONString ];
    [ "TicketID" ; Shipping Scale Ticket::TicketID ;  JSONString ]
    
    )

-X POST "https:/123456" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEwMjQiLCJ1bmlxdWVfbmFtZSI6IkdyYWluIFNjYWxlIFRlc3QiLCJTZXJ2ZXJOYW1lIjoiREVWVEVTVDUiLCJEYXRhYmFzZU5hbWUiOiJURVNUUExBWSIsInJvbGUiOlsiV3JpdGUiLCJHcmFpblNjYWxlIl0sIm5iZiI6MTY4MDIzMzMzOSwiZXhwIjoxNjgwMzE5NzM5LCJpYXQiOjE2ODAyMzMzMzl9.GfLOdsxyXDN7egKUUPZz-hwEqcBdQ41GYiYkfwNiQm8" -H  "Content-Type: application/json"-d "{"JobID":"1","TicketID":"ss1"}"

 

This is the error message that I get:

? * Line 1, Column 1
  Syntax error: value, object or array expected.

TIA 

John

 

  • Author

Seems to be a problem with the insert URL script step. If I paste the FileMaker generated code via Run Curl Commands Online (reqbin.com) it works. Wondering if there is an alternative method to post from FileMaker. Maybe a plugin?

50 minutes ago, John F said:

Seems to be a problem with the insert URL script step.

I don't think so. But it is difficult for me to give you specific advice without knowing exactly (a) what you did and (b) what you should do (i.e. what are the API's specifications). 

 

52 minutes ago, John F said:

If I paste the FileMaker generated code via Run Curl Commands Online (reqbin.com) it works.

That doesn't mean anything. I thought you would know that, since you said here you have read this

 

54 minutes ago, John F said:

Maybe a plugin?

The BaseElements plugin does offer an alternative method. So does MBS and perhaps others. But IMHO your problem is not with the tool but with what to do do with it.

 

 

  • Author

Comment, thanks for your help. I followed your lead and did some more reading. I found one error and that got me a step further. Now I am stuck on:

{
    "errors" : 
    {
        "$" : 
        [
            "Expected depth to be zero at the end of the JSON payload. There is an open JSON object or array that should be closed. Path: $ | LineNumber: 0 | BytePositionInLine: 1."
        ]
    },
    "status" : 400,
    "title" : "One or more validation errors occurred.".

I am only posting 1 record.

There is very little documentation with the API.  I used the data parser downloader from the Solian site and it didn't flag any issues.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.