Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

Magento2 REST API

All examples are included with download of MBS FileMaker Plugin.

Magento2 REST API.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts5
Value Lists0
Custom Functions0
Custom Menus24
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
tbl_debugger
6 fields defined, 1 record
tbl_debugger

Fields

Table Name: tbl_debugger - 6 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
MagentoURLNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      headerNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          responseNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              tokenNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  Product NameNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      PEM FileNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German

                            Layout Objects: tbl_debugger

                            Regular Fields

                            Field Name: tbl_debugger::PEM File
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 523 pt
                            • Left: 188 pt
                            • Bottom: 545 pt
                            • Right: 441 pt
                            • Anchoring: Left, Top
                            Field Format:
                            • Edit Box
                            Field Behavior:
                            • Allow field to be entered: In Find mode, In Browse mode
                            • Touch keyboard type: Default for Data Type
                            • Go to next field using: Tab key
                            Yes

                            Field Name: tbl_debugger::MagentoURL
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 107 pt
                            • Left: 188 pt
                            • Bottom: 129 pt
                            • Right: 441 pt
                            • Anchoring: Left, Top
                            Field Format:
                            • Edit Box
                            Field Behavior:
                            • Allow field to be entered: In Find mode, In Browse mode
                            • Touch keyboard type: Default for Data Type
                            • Go to next field using: Tab key
                            Yes

                            Field Name: tbl_debugger::header
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 131 pt
                            • Left: 188 pt
                            • Bottom: 271 pt
                            • Right: 1006 pt
                            • Anchoring: Left, Top
                            Field Format:
                            • Edit Box
                            Field Behavior:
                            • Allow field to be entered: In Find mode, In Browse mode
                            • Touch keyboard type: Default for Data Type
                            • Go to next field using: Tab key
                            Yes

                            Field Name: tbl_debugger::response
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 274 pt
                            • Left: 188 pt
                            • Bottom: 454 pt
                            • Right: 1006 pt
                            • Anchoring: Left, Top
                            Field Format:
                            • Edit Box
                            Field Behavior:
                            • Allow field to be entered: In Find mode, In Browse mode
                            • Touch keyboard type: Default for Data Type
                            • Go to next field using: Tab key
                            Yes

                            Field Name: tbl_debugger::token
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 465 pt
                            • Left: 188 pt
                            • Bottom: 487 pt
                            • Right: 441 pt
                            • Anchoring: Left, Top
                            Field Format:
                            • Edit Box
                            Field Behavior:
                            • Allow field to be entered: In Find mode, In Browse mode
                            • Touch keyboard type: Default for Data Type
                            • Go to next field using: Tab key
                            Yes

                            Field Name: tbl_debugger::Product Name
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 489 pt
                            • Left: 188 pt
                            • Bottom: 511 pt
                            • Right: 441 pt
                            • Anchoring: Left, Top
                            Field Format:
                            • Edit Box
                            Field Behavior:
                            • Allow field to be entered: In Find mode, In Browse mode
                            • Touch keyboard type: Default for Data Type
                            • Go to next field using: Tab key
                            Yes

                            Buttons

                            Button PropertiesCoordinatesScript/Script Step
                              Type:
                            • Text: Get Token
                            • Top: 581 pt
                            • Left: 188 pt
                            • Bottom: 629 pt
                            • Right: 288 pt
                            • Anchoring: Left, Top
                            Perform Script [ “Token Auth” ]

                            Scripts:


                            Button PropertiesCoordinatesScript/Script Step
                              Type:
                            • Text: Create SKU
                            • Top: 581 pt
                            • Left: 310 pt
                            • Bottom: 629 pt
                            • Right: 410 pt
                            • Anchoring: Left, Top
                            Perform Script [ “Post SKU” ]

                            Scripts:


                            Button PropertiesCoordinatesScript/Script Step
                              Type:
                            • Text: Update SKU
                            • Top: 581 pt
                            • Left: 544 pt
                            • Bottom: 629 pt
                            • Right: 644 pt
                            • Anchoring: Left, Top
                            Perform Script [ “Put SKU” ]

                            Scripts:


                            Button PropertiesCoordinatesScript/Script Step
                              Type:
                            • Text: Delete SKU
                            • Top: 581 pt
                            • Left: 664 pt
                            • Bottom: 629 pt
                            • Right: 764 pt
                            • Anchoring: Left, Top
                            Perform Script [ “Delete SKU” ]

                            Scripts:


                            Button PropertiesCoordinatesScript/Script Step
                              Type:
                            • Text: Get SKU
                            • Top: 581 pt
                            • Left: 432 pt
                            • Bottom: 629 pt
                            • Right: 532 pt
                            • Anchoring: Left, Top
                            Perform Script [ “Get SKU” ]

                            Scripts:


                            Script Hierarchy

                            Token Auth
                            Post SKU
                            Get SKU
                            Put SKU
                            Delete SKU

                            Next Script: [Post SKU]
                            Script NameToken Auth
                            Run script with full access privilegesOff
                            Include In MenuNo
                            Layouts that use this script
                            Scripts that use this script
                              Script Definition
                              Script Steps
                              Fields used in this script
                              Scripts used in this script
                                Layouts used in this script
                                  Tables used in this script
                                  Table occurrences used by this script
                                  Custom Functions used by this script
                                    Custom menu set used by this script

                                      Previous Script: [Token Auth]Next Script: [Get SKU]
                                      Script NamePost SKU
                                      Run script with full access privilegesOff
                                      Include In MenuNo
                                      Layouts that use this script
                                      Scripts that use this script
                                        Script Definition
                                        Script Steps
                                        • Set Variable [ $Token; Value:tbl_debugger::token ]
                                        • Set Variable [ $Curl; Value:MBS("CURL.New") ]
                                        • #Change path to your CACert PEM File.
                                        • Set Variable [ $CacertPath; Value:"C:\Users\Public\cacert.pem" ]
                                        • Set Variable [ $Result; Value:MBS( "CURL.SetOptionCAInfo"; $curl; $cacertPath ) ]
                                        • Set Variable [ $Result; Value:MBS( "CURL.SetOptionSSLVerifyHost"; $curl; 2 ) ]
                                        • Set Variable [ $Result; Value:MBS( "CURL.SetOptionSSLVerifyPeer"; $curl; 1 ) ]
                                        • Set Variable [ $Result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                        • Set Variable [ $Result; Value:MBS("CURL.SetOptionURL"; $curl; tbl_debugger::MagentoURL&"/rest/V1/products") ]
                                        • Set Variable [ $Result; Value:MBS("CURL.SetOptionPost"; $curl; 1) ]
                                        • Set Variable [ $result; Value:MBS("CURL.SetOptionHTTPHeader"; $curl; "Content-Type: application/json" ; "Authorization: Bearer " & $Token ; "Cache-Control: no-cache" ) ]
                                        • Set Variable [ $Body; Value:" { \"product\": { \"sku\": \""&tbl_debugger::Product Name&"\", \"name\": \" "&tbl_debugger::Product Name&" \", \"price\": 30.00, \"status\": 1, \"type_id\": \"simple\", \"attribute_set_id\":4, \"weight\": 1 } } " ]
                                        • Set Variable [ $result; Value:MBS("CURL.SetOptionPostFields"; $curl; $Body ; "UTF-8") ]
                                        • Set Variable [ $Result; Value:MBS("CURL.Perform"; $curl) ]
                                        • Set Variable [ $Header; Value:MBS("CURL.GetDebugMessages"; $curl) ]
                                        • Set Variable [ $Response; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetResultAsText"; $curl);1) ]
                                        • Set Variable [ $Result; Value:MBS("CURL.Cleanup"; $curl) ]
                                        • Set Field [ tbl_debugger::header; $Header ]
                                        • Set Field [ tbl_debugger::response; $Response ]
                                        Fields used in this script
                                        Scripts used in this script
                                          Layouts used in this script
                                            Tables used in this script
                                            Table occurrences used by this script
                                            Custom Functions used by this script
                                              Custom menu set used by this script

                                                Previous Script: [Post SKU]Next Script: [Put SKU]
                                                Script NameGet SKU
                                                Run script with full access privilegesOff
                                                Include In MenuNo
                                                Layouts that use this script
                                                Scripts that use this script
                                                  Script Definition
                                                  Script Steps
                                                  Fields used in this script
                                                  Scripts used in this script
                                                    Layouts used in this script
                                                      Tables used in this script
                                                      Table occurrences used by this script
                                                      Custom Functions used by this script
                                                        Custom menu set used by this script

                                                          Previous Script: [Get SKU]Next Script: [Delete SKU]
                                                          Script NamePut SKU
                                                          Run script with full access privilegesOff
                                                          Include In MenuNo
                                                          Layouts that use this script
                                                          Scripts that use this script
                                                            Script Definition
                                                            Script Steps
                                                            • Set Variable [ $Token; Value:tbl_debugger::token ]
                                                            • Set Variable [ $Curl; Value:MBS("CURL.New") ]
                                                            • #Change path to your CACert PEM File.
                                                            • Set Variable [ $CacertPath; Value:"C:\Users\Public\cacert.pem" ]
                                                            • Set Variable [ $Result; Value:MBS( "CURL.SetOptionCAInfo"; $curl; $cacertPath ) ]
                                                            • Set Variable [ $Result; Value:MBS( "CURL.SetOptionSSLVerifyHost"; $curl; 2 ) ]
                                                            • Set Variable [ $Result; Value:MBS( "CURL.SetOptionSSLVerifyPeer"; $curl; 1 ) ]
                                                            • Set Variable [ $Result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                                            • #PUT item
                                                            • Set Variable [ $Result; Value:MBS("CURL.SetOptionURL"; $curl; tbl_debugger::MagentoURL&"/rest/V1/products/"&tbl_debugger::Product Name) ]
                                                            • Set Variable [ $result; Value:MBS("CURL.SetOptionHTTPHeader"; $curl; "Content-Type: application/json" ; "Authorization: Bearer "&$token&"" ) ]
                                                            • Set Variable [ $result; Value:MBS("CURL.SetOptionUpload"; $curl; 1) ]
                                                            • Set Variable [ $Body; Value:" { \"product\": { \"sku\": \""&tbl_debugger::Product Name&"\", \"name\": \""&tbl_debugger::Product Name&"\", \"price\": 35.01, \"status\": 1, \"type_id\": \"simple\", \"attribute_set_id\":4, \"weight\": 1 } } " ]
                                                            • Set Variable [ $result; Value:MBS("CURL.SetInputText"; $curl; $Body ) ]
                                                            • Set Variable [ $Result; Value:MBS("CURL.Perform"; $curl) ]
                                                            • Set Variable [ $Header; Value:MBS("CURL.GetDebugMessages"; $curl) ]
                                                            • Set Variable [ $Response; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetResultAsText"; $curl);1) ]
                                                            • Set Variable [ $Result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                            • Set Field [ tbl_debugger::header; $Header ]
                                                            • Set Field [ tbl_debugger::response; $Response ]
                                                            Fields used in this script
                                                            Scripts used in this script
                                                              Layouts used in this script
                                                                Tables used in this script
                                                                Table occurrences used by this script
                                                                Custom Functions used by this script
                                                                  Custom menu set used by this script

                                                                    Previous Script: [Put SKU]
                                                                    Script NameDelete SKU
                                                                    Run script with full access privilegesOff
                                                                    Include In MenuNo
                                                                    Layouts that use this script
                                                                    Scripts that use this script
                                                                      Script Definition
                                                                      Script Steps
                                                                      • Set Variable [ $Token; Value:tbl_debugger::token ]
                                                                      • Set Variable [ $Curl; Value:MBS("CURL.New") ]
                                                                      • #Change path to your CACert PEM File.
                                                                      • Set Variable [ $CacertPath; Value:"C:\Users\Public\cacert.pem" ]
                                                                      • Set Variable [ $Result; Value:MBS( "CURL.SetOptionCAInfo"; $curl; $cacertPath ) ]
                                                                      • Set Variable [ $Result; Value:MBS( "CURL.SetOptionSSLVerifyHost"; $curl; 2 ) ]
                                                                      • Set Variable [ $Result; Value:MBS( "CURL.SetOptionSSLVerifyPeer"; $curl; 1 ) ]
                                                                      • Set Variable [ $Result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                                                      • #Delete SKU
                                                                      • Set Variable [ $Result; Value:MBS("CURL.SetOptionURL"; $curl; tbl_debugger::MagentoURL&"/rest/V1/products/"&tbl_debugger::Product Name) ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionHTTPHeader"; $curl; "Content-Type: application/json" ; "Authorization: Bearer "&$Token&"" ) ]
                                                                      • Set Variable [ $Result; Value:MBS( "CURL.SetOptionCustomRequest"; $curl; "DELETE" ) ]
                                                                      • Set Variable [ $Result; Value:MBS("CURL.Perform"; $curl) ]
                                                                      • Set Variable [ $Header; Value:MBS("CURL.GetDebugMessages"; $curl) ]
                                                                      • Set Variable [ $Response; Value:MBS("CURL.GetResultAsText"; $curl) ]
                                                                      • Set Variable [ $Result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                      • Set Field [ tbl_debugger::header; $Header ]
                                                                      • Set Field [ tbl_debugger::response; $Response ]
                                                                      Fields used in this script
                                                                      Scripts used in this script
                                                                        Layouts used in this script
                                                                          Tables used in this script
                                                                          Table occurrences used by this script
                                                                          Custom Functions used by this script
                                                                            Custom menu set used by this script

                                                                              Download example: Magento2 REST API

                                                                              Used functions: