Results 1 to 4 of 4

Thread: Bluepark and Filemaker API integration

  1. #1
    Join Date
    Jun 2012
    Location
    South West England
    Posts
    224

    Default Bluepark and Filemaker API integration

    I have managed to do a simple API call between Filemaker and Bluepark using the filemaker scripting language. This will be a game-changer for me as allows me to ADD/UPDATE/DELETE Bluepark records within Filemake and hence do a few things on Filemaker that were not possible on Bluepark. Hopefully this could be useful proof-of-concept for other Blueparkers...

    Here is a sample script to retrieve the AddressLine1 of a given Bluepark User record, you would have to use your own apikey - I have made this one up.
    I have a simple filemaker layout consisting of a UserID field that matches a Bluepark User ID value. This is passed in as a Script Parameter.
    Within the layout I have a large text field associated with the filemaker variable of $response. Also a simple text field called BP_Addr1 that is associated with the variable

    Within the filemaker script dialog box I created the following script...

    Code:
    Set Variable [$BP_ID;Value:Get(ScriptParameter)]
    Set Variable [$username; Value:"api"]
    Set Variable [$apikey;Value:"12345hekeu2983d928439shwi4283848s838"]
    Set Variable [$url;Value:"https://www.yourblueparksite.com/api/v1/users/" & $BP_ID]
    Set Variable [$auth; Value:Base64EncodeRFC(4648 ; $username & ":" & $apikey)]
    Set Variable[$urlOptions; Value:-- GET --header \"Authorization: Basic " & $auth & "\" "]
    Set Variable[$response]
    Insertfrom URL [$response; $url;cURL options:$urlOptions] 
         [Select;No dialog]
    Set Field[MyTableName::APIResponse;JSONFormatElements($response)]
    Set Field[MyTableName::BP_Addr1;APIResponse;JSONGetElement($response;"address_line_1")]
    Put the script on a button on the layout and updates in miliseconds like magic. You can see the JSON response, nicely formatted in the $response text box and this helps see what is happening.

    By changing the 'GET' to a 'PUT' you can update Bluepark fields from Filemaker. You can extend it to populate all fields in a user record. Put it in a small looping script and you can update a filemaker database in real-time? I hope you can see that there are a lot of Filemaker possibilities once this is working...

    Regards
    Rob

  2. #2
    Join Date
    Jun 2012
    Location
    South West England
    Posts
    224

    Default

    For the avoidance of doubt $username in the example above relates to a Admin Bluepark username of 'api' (in my instance) that has full API access.

    Code:
    Set Variable [$username; Value:"api"]

  3. #3
    Join Date
    Dec 2007
    Location
    Cumbria
    Posts
    3,699

    Default

    Thanks for sharing Rob
    Regards,

    Dave

  4. #4
    Join Date
    Oct 2015
    Posts
    123

    Default

    Quote Originally Posted by Bandanashop View Post
    I have managed to do a simple API call between Filemaker and Bluepark using the filemaker scripting language. This will be a game-changer for me as allows me to ADD/UPDATE/DELETE Bluepark records within Filemake and hence do a few things on Filemaker that were not possible on Bluepark. Hopefully this could be useful proof-of-concept for other Blueparkers...

    Here is a sample script to retrieve the AddressLine1 of a given Bluepark User record, you would have to use your own apikey - I have made this one up.
    I have a simple filemaker layout consisting of a UserID field that matches a Bluepark User ID value. This is passed in as a Script Parameter.
    Within the layout I have a large text field associated with the filemaker variable of $response. Also a simple text field called BP_Addr1 that is associated with the variable

    Within the filemaker script dialog box I created the following script...

    Code:
    Set Variable [$BP_ID;Value:Get(ScriptParameter)]
    Set Variable [$username; Value:"api"]
    Set Variable [$apikey;Value:"12345hekeu2983d928439shwi4283848s838"]
    Set Variable [$url;Value:"https://www.yourblueparksite.com/api/v1/users/" & $BP_ID]
    Set Variable [$auth; Value:Base64EncodeRFC(4648 ; $username & ":" & $apikey)]
    Set Variable[$urlOptions; Value:-- GET --header \"Authorization: Basic " & $auth & "\" "]
    Set Variable[$response]
    Insertfrom URL [$response; $url;cURL options:$urlOptions] 
         [Select;No dialog]
    Set Field[MyTableName::APIResponse;JSONFormatElements($response)]
    Set Field[MyTableName::BP_Addr1;APIResponse;JSONGetElement($response;"address_line_1")]
    Put the script on a button on the layout and updates in miliseconds like magic. You can see the JSON response, nicely formatted in the $response text box and this helps see what is happening.

    By changing the 'GET' to a 'PUT' you can update Bluepark fields from Filemaker. You can extend it to populate all fields in a user record. Put it in a small looping script and you can update a filemaker database in real-time? I hope you can see that there are a lot of Filemaker possibilities once this is working...

    Regards
    Rob
    This is great Rob. I use Filemaker and exports to get products into BP. This would be so useful for me.

Similar Threads

  1. DPD (Local) API Integration
    By MooreSpeed in forum Bluepark Technical Discussion
    Replies: 6
    Last Post: 08-06-2019, 12:37
  2. Amazon Pending Orders - API Integration
    By Les78 in forum Bluepark Technical Discussion
    Replies: 8
    Last Post: 01-04-2015, 21:51
  3. API Development/ Integration
    By Nightcrawler in forum Bluepark API and Developer Partners
    Replies: 0
    Last Post: 10-12-2014, 20:03
  4. API, Sage, Salesforce Integration
    By Chrisg in forum Bluepark API and Developer Partners
    Replies: 0
    Last Post: 11-02-2014, 12:21
  5. Bluepark / Ebay / Amazon API Integration
    By Sarah in forum Online Marketing and Promotion
    Replies: 7
    Last Post: 17-02-2011, 09:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us

Bluepark's ecommerce software is developed, hosted and supported exclusively by ourselves, here in the UK, and has been so since the company was initially formed in 2004. Your brand new online shop will be hosted securely on our fast and reliable server network, using a domain name of your choice, providing the ability to build and maintain your ecommerce website, and manage your orders, from any location via your own secure online Administration Console.

A Bluepark ecommerce site is the perfect tool for selling online, whether you're selling physical products, digital downloads or services. You'll be in good company with over 1,000 UK customers who also form a friendly and helpful online community, further strengthening our highly acclaimed support network.

Find us on...