MBS FileMaker Plugin Example Databases

ebay Webservice

All examples are included with download of MBS FileMaker Plugin.

ebay Webservice.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts5
Value Lists0
Custom Functions0
Custom Menus0
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
ebay Webservice
9 fields defined, 1 record
ebay Webservice

Fields

Table Name: ebay Webservice - 9 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
Client IDNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
  • Index Language: German
      Client SecretNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Global
      • Repetitions: 1
      • Index Language: German
          RunameNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Global
          • Repetitions: 1
          • Index Language: German
              RequestNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  DebugMessagesNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      ResultNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                          AccessTokenNormal, TextAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Global
                          • Repetitions: 1
                          • Index Language: German
                              RefreshTokenNormal, TextAuto-Enter:
                              • Allow editing
                              Validation:
                              • Only during data entry
                              Storage:
                              • Global
                              • Repetitions: 1
                              • Index Language: German
                                  CodeNormal, TextAuto-Enter:
                                  • Allow editing
                                  Validation:
                                  • Only during data entry
                                  Storage:
                                  • Global
                                  • Repetitions: 1
                                  • Index Language: German

                                      Layout Objects: ebay Webservice

                                      Regular Fields

                                      Field Name: ebay Webservice::Client ID
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 24 pt
                                      • Left: 108 pt
                                      • Bottom: 45 pt
                                      • Right: 485 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
                                      No

                                      Field Name: ebay Webservice::Client Secret
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 47 pt
                                      • Left: 108 pt
                                      • Bottom: 68 pt
                                      • Right: 485 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
                                      No

                                      Field Name: ebay Webservice::Runame
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 71 pt
                                      • Left: 108 pt
                                      • Bottom: 92 pt
                                      • Right: 485 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
                                      No

                                      Field Name: ebay Webservice::AccessToken
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 48 pt
                                      • Left: 595 pt
                                      • Bottom: 69 pt
                                      • Right: 972 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
                                      No

                                      Field Name: ebay Webservice::RefreshToken
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 71 pt
                                      • Left: 595 pt
                                      • Bottom: 92 pt
                                      • Right: 972 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
                                      No

                                      Field Name: ebay Webservice::Result
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 362 pt
                                      • Left: 81 pt
                                      • Bottom: 604 pt
                                      • Right: 473 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: ebay Webservice::Request
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 185 pt
                                      • Left: 81 pt
                                      • Bottom: 356 pt
                                      • Right: 473 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: ebay Webservice::DebugMessages
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 161 pt
                                      • Left: 481 pt
                                      • Bottom: 604 pt
                                      • Right: 960 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: ebay Webservice::Code
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 24 pt
                                      • Left: 596 pt
                                      • Bottom: 45 pt
                                      • Right: 972 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
                                      No

                                      Buttons

                                      Button PropertiesCoordinatesScript/Script Step
                                        Type:
                                      • Text: Login
                                      • Top: 142 pt
                                      • Left: 20 pt
                                      • Bottom: 171 pt
                                      • Right: 154 pt
                                      • Anchoring: Left, Top
                                      Perform Script [ “LoadLogin” ]

                                      Scripts:


                                      Button PropertiesCoordinatesScript/Script Step
                                        Type:
                                      • Text: Copy Code
                                      • Top: 142 pt
                                      • Left: 171 pt
                                      • Bottom: 172 pt
                                      • Right: 305 pt
                                      • Anchoring: Left, Top
                                      Perform Script [ “Get Code” ]

                                      Scripts:


                                      Button PropertiesCoordinatesScript/Script Step
                                        Type:
                                      • Text: Get Access Token
                                      • Top: 144 pt
                                      • Left: 21 pt
                                      • Bottom: 177 pt
                                      • Right: 137 pt
                                      • Anchoring: Left, Top
                                      Perform Script [ “Get Access Token” ]

                                      Scripts:


                                      Button PropertiesCoordinatesScript/Script Step
                                        Type:
                                      • Text: Refresh Access Token
                                      • Top: 144 pt
                                      • Left: 149 pt
                                      • Bottom: 177 pt
                                      • Right: 304 pt
                                      • Anchoring: Left, Top
                                      Perform Script [ “Refresh Token” ]

                                      Scripts:


                                      Button PropertiesCoordinatesScript/Script Step
                                        Type:
                                      • Text: Query Orders
                                      • Top: 144 pt
                                      • Left: 315 pt
                                      • Bottom: 177 pt
                                      • Right: 470 pt
                                      • Anchoring: Left, Top
                                      Perform Script [ “Query orders” ]

                                      Scripts:


                                      Tab Controls

                                      Tab Control PropertiesCoordinates
                                        Justification:
                                      • Left
                                        Tab Width:
                                        Default Front Tab:
                                      • Tab 0
                                      • Top: 109 pt
                                      • Left: 7 pt
                                      • Bottom: 615 pt
                                      • Right: 1015 pt
                                      • Anchoring: Left, Top
                                      Tabs
                                      Tab PropertiesTab ControlsSlide ControlsFieldsButtonsPortalsWeb Viewer ControlsCharts
                                        Tab 0:
                                      • "Login"
                                        Object Name:
                                      • tabs
                                        • Text: Login-->Perform Script [ “LoadLogin” ] at (142, 20, 171, 154)
                                        • Text: Copy Code-->Perform Script [ “Get Code” ] at (142, 171, 172, 305)
                                        • 1 Web Viewer Controls
                                            Tab 1:
                                          • "Functions"
                                              Field Objects
                                            • Text: Get Access Token-->Perform Script [ “Get Access Token” ] at (144, 21, 177, 137)
                                            • Text: Refresh Access Token-->Perform Script [ “Refresh Token” ] at (144, 149, 177, 304)
                                            • Text: Query Orders-->Perform Script [ “Query orders” ] at (144, 315, 177, 470)

                                            • Web Viewer Controls

                                              Web Viewer Control PropertiesCoordinatesWeb Address
                                                Object Name:
                                              • web
                                                Additional Properties:
                                              • Allow interaction with web viewer content
                                              • Display progress bar
                                              • Display status messages
                                              • Automatically encode URL
                                              • Top: 184 pt
                                              • Left: 20 pt
                                              • Bottom: 602 pt
                                              • Right: 1004 pt
                                              • Anchoring: Left, Top
                                              "about:blank"

                                              Script Hierarchy

                                              LoadLogin
                                              Get Code
                                              Get Access Token
                                              Refresh Token
                                              Query orders

                                              Next Script: [Get Code]
                                              Script NameLoadLogin
                                              Run script with full access privilegesOff
                                              Include In MenuYes
                                              Layouts that use this script
                                              Scripts that use this script
                                                Script Definition
                                                Script Steps
                                                • Go to Object [ Object Name: "Login" ]
                                                • Go to Object [ Object Name: "Web" ]
                                                • Set Variable [ $scopes; Value:"https://api.ebay.com/oauth/api_scope https://api.ebay.com/oauth/api_scope/sell.marketing https://api.ebay.com/oauth/api_scope/sell.inventory https://api.ebay.com/oauth/api_scope/sell.account https://api.ebay.com/oauth/api_scope/sell.fulfillment" ]
                                                • Set Variable [ $scopes; Value:Substitute($scopes; Char(13); " ") ]
                                                • Set Variable [ $scopes; Value:Substitute($scopes; Char(10); " ") ]
                                                • // Set Variable [ $scopes; Value:Substitute($scopes; " "; "%20") ]
                                                • Set Variable [ $URL; Value:"https://auth.sandbox.ebay.com/oauth2/authorize?client_id=" & ebay Webservice::Client ID & "&response_type=code&redirect_uri=" & ebay Webservice::Runame & "&scope=" & $scopes ]
                                                • Set Web Viewer [ Object Name: "web"; URL: $URL ]
                                                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: [LoadLogin]Next Script: [Get Access Token]
                                                        Script NameGet Code
                                                        Run script with full access privilegesOff
                                                        Include In MenuYes
                                                        Layouts that use this script
                                                        Scripts that use this script
                                                          Script Definition
                                                          Script Steps
                                                          • Set Variable [ $text; Value:MBS( "WebView.GetPlainText"; "web" ) ]
                                                          • Set Variable [ $text; Value:Trim($text) ]
                                                          • If [ Left ( $text ; 19 ) = "eBay Login Accepted" ]
                                                          • Set Variable [ $code; Value:Trim(Middle($text; 22; Length($text))) ]
                                                          • Set Field [ ebay Webservice::Code; $code ]
                                                          • End If
                                                          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 Code]Next Script: [Refresh Token]
                                                                  Script NameGet Access Token
                                                                  Run script with full access privilegesOff
                                                                  Include In MenuYes
                                                                  Layouts that use this script
                                                                  Scripts that use this script
                                                                    Script Definition
                                                                    Script Steps
                                                                    • #https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html
                                                                    • #Start new session
                                                                    • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                    • #Set URL to load (HTTP, HTTPS, FTP, FTPS, SFTP, etc.)
                                                                    • Set Variable [ $r; Value:MBS("CURL.SetOptionURL"; $curl; "https://api.sandbox.ebay.com/identity/v1/oauth2/token") ]
                                                                    • Set Variable [ $r; Value:MBS("CURL.SetOptionHTTPHeader"; $curl; "application/x-www-form-urlencoded") ]
                                                                    • Set Variable [ $r; Value:MBS("CURL.SetOptionUsername"; $curl; ebay Webservice::Client ID) ]
                                                                    • Set Variable [ $r; Value:MBS("CURL.SetOptionPassword"; $curl; ebay Webservice::Client Secret) ]
                                                                    • Set Variable [ $r; Value:MBS("CURL.SetDebugWithData"; $curl; 1) ]
                                                                    • Set Variable [ $request; Value:"grant_type=authorization_code&code=" & ebay Webservice::Code & "&redirect_uri=Christian_Schmi-Christia-MBSTes-kbrjfkry" ]
                                                                    • Set Variable [ $r; Value:MBS("CURL.SetOptionPostFields"; $curl; $request) ]
                                                                    • #RUN now
                                                                    • Set Variable [ $r; Value:MBS("CURL.Perform"; $curl) ]
                                                                    • #Check result
                                                                    • Set Variable [ $json; Value:MBS("CURL.GetResultAsText"; $curl; "UTF8") ]
                                                                    • Set Field [ ebay Webservice::Result; $json ]
                                                                    • Set Field [ ebay Webservice::Request; $request ]
                                                                    • Set Field [ ebay Webservice::DebugMessages; MBS("CURL.GetDebugAsText"; $curl) ]
                                                                    • Set Variable [ $ResponseCode; Value:MBS( "CURL.GetResponseCode"; $curl ) ]
                                                                    • If [ $r = "OK" and $ResponseCode = 200 ]
                                                                    • Set Variable [ $access_token; Value:MBS( "JSON.GetPathItem"; $json; "access_token"; 3 ) ]
                                                                    • Set Variable [ $expires_in; Value:MBS( "JSON.GetPathItem"; $json; "expires_in"; 3 ) ]
                                                                    • Set Variable [ $refresh_token; Value:MBS( "JSON.GetPathItem"; $json; "refresh_token"; 3 ) ]
                                                                    • Set Variable [ $refresh_token_expires_in; Value:MBS( "JSON.GetPathItem"; $json; "refresh_token_expires_in"; 3 ) ]
                                                                    • Set Variable [ $token_type; Value:MBS( "JSON.GetPathItem"; $json; "token_type"; 3 ) ]
                                                                    • Set Field [ ebay Webservice::AccessToken; $access_token ]
                                                                    • Set Field [ ebay Webservice::RefreshToken; $refresh_token ]
                                                                    • End If
                                                                    • #Cleanup
                                                                    • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                    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 Access Token]Next Script: [Query orders]
                                                                            Script NameRefresh Token
                                                                            Run script with full access privilegesOff
                                                                            Include In MenuYes
                                                                            Layouts that use this script
                                                                            Scripts that use this script
                                                                              Script Definition
                                                                              Script Steps
                                                                              • #https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html
                                                                              • #Start new session
                                                                              • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                              • #Set URL to load (HTTP, HTTPS, FTP, FTPS, SFTP, etc.)
                                                                              • Set Variable [ $r; Value:MBS("CURL.SetOptionURL"; $curl; "https://api.sandbox.ebay.com/identity/v1/oauth2/token") ]
                                                                              • Set Variable [ $r; Value:MBS("CURL.SetOptionHTTPHeader"; $curl; "application/x-www-form-urlencoded") ]
                                                                              • Set Variable [ $r; Value:MBS("CURL.SetOptionUsername"; $curl; ebay Webservice::Client ID) ]
                                                                              • Set Variable [ $r; Value:MBS("CURL.SetOptionPassword"; $curl; ebay Webservice::Client Secret) ]
                                                                              • Set Variable [ $r; Value:MBS("CURL.SetOptionPostFields"; $curl; "grant_type=refresh_token&refresh_token=" & ebay Webservice::RefreshToken & "&redirect_uri=" & ebay Webservice::Runame) ]
                                                                              • Set Variable [ $r; Value:MBS("CURL.SetDebugWithData"; $curl; 1) ]
                                                                              • #RUN now
                                                                              • Set Variable [ $r; Value:MBS("CURL.Perform"; $curl) ]
                                                                              • #Check result
                                                                              • Set Variable [ $json; Value:MBS("CURL.GetResultAsText"; $curl; "UTF8") ]
                                                                              • Set Field [ ebay Webservice::Result; $json ]
                                                                              • Set Field [ ebay Webservice::DebugMessages; MBS("CURL.GetDebugAsText"; $curl) ]
                                                                              • Set Variable [ $ResponseCode; Value:MBS( "CURL.GetResponseCode"; $curl ) ]
                                                                              • If [ $r = "OK" and $ResponseCode = 200 ]
                                                                              • Set Variable [ $access_token; Value:MBS( "JSON.GetPathItem"; $json; "access_token"; 3 ) ]
                                                                              • Set Variable [ $expires_in; Value:MBS( "JSON.GetPathItem"; $json; "expires_in"; 3 ) ]
                                                                              • Set Variable [ $token_type; Value:MBS( "JSON.GetPathItem"; $json; "token_type"; 3 ) ]
                                                                              • Set Field [ ebay Webservice::AccessToken; $access_token ]
                                                                              • End If
                                                                              • #Cleanup
                                                                              • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                              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: [Refresh Token]
                                                                                      Script NameQuery orders
                                                                                      Run script with full access privilegesOff
                                                                                      Include In MenuYes
                                                                                      Layouts that use this script
                                                                                      Scripts that use this script
                                                                                        Script Definition
                                                                                        Script Steps
                                                                                        • Go to Object [ Object Name: "Authorization" ]
                                                                                        • #Start new session
                                                                                        • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                                        • #Set URL to load (HTTP, HTTPS, FTP, FTPS, SFTP, etc.)
                                                                                        • Set Variable [ $URL; Value:"https://api.sandbox.ebay.com/sell/fulfillment/v1/order" ]
                                                                                        • Set Variable [ $r; Value:MBS( "CURL.SetOptionURL"; $curl; $URL) ]
                                                                                        • Set Variable [ $r; Value:MBS( "CURL.SetOptionHTTPHeader"; $curl; "Accept: application/json"; "Authorization: Bearer " & ebay Webservice::AccessToken) ]
                                                                                        • // Set Variable [ $r; Value:MBS( "CURL.SetOptionXOAuth2Bearer"; $curl; ebay Webservice::AccessToken ) ]
                                                                                        • Set Variable [ $r; Value:MBS("CURL.SetDebugWithData"; $curl; 1) ]
                                                                                        • // Set Variable [ $r; Value:MBS( "CURL.SetupOAuth"; $curl; ebay Webservice::Client ID; ebay Webservice::Client Secret; ebay Webservice::AccessToken; ""; "GET"; $URL) ]
                                                                                        • #RUN now
                                                                                        • Set Variable [ $r; Value:MBS("CURL.Perform"; $curl) ]
                                                                                        • #Check result
                                                                                        • Set Field [ ebay Webservice::Request; "" ]
                                                                                        • Set Field [ ebay Webservice::Result; MBS("CURL.GetResultAsText"; $curl; "UTF8") ]
                                                                                        • Set Field [ ebay Webservice::DebugMessages; MBS("CURL.GetDebugAsText"; $curl) ]
                                                                                        • #Cleanup
                                                                                        • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                                        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: ebay Webservice

                                                                                                Used functions:




                                                                                                Links
                                                                                                MBS Xojo Chart Plugins