Uniface User Forum

 View Only
  • 1.  Working with an API with Uniface

    Posted 05-20-2022 10:41
    Hello Unifacers

    We would like to interface our Uniface Application with an API to publish and access to external data
    It exists an "Universal"  api for our business (we are working in research for Plant breeding) .
    This api is called BrAPI :  BrAPI

    Is anybody have an experience in UNiface and Api ?
    I have no idea if it could be possible to work with Uniface  and this BrAPI...
    Anybody can help us some way ?
    Many Thanks in advance
    Daniel

    ------------------------------
    CABERO Daniel
    Lead of IT R&D Lidea
    LIDEA France
    MONDONVILLE FR
    ------------------------------


  • 2.  RE: Working with an API with Uniface

    PARTNER
    Posted 05-20-2022 10:55
    So that is a REST API. 
    It is possible to use the UHTTP code to interface with REST APIs, we have done it with different applications.
    As it uses JSON, it's probably easiest if you have a later version of Uniface  where you can build your data in structs and convert to JSON and vice versa. 
    Regards, 
    Iain

    ------------------------------
    Iain Sharp
    Head of Technical Services
    Pci Systems Ltd
    Sheffield GB
    ------------------------------



  • 3.  RE: Working with an API with Uniface

    Posted 05-21-2022 19:15
    Thank you for your response,  Iain !
    We are in Uniface 10.4 , but not on web mode.
    Our uniface applications are working in client server mode on citrix servers.
    Do you think we could do that anyway?
    We are not familiarized to work with Api... could you help us to orienteded ?
    Many thnaks in advance
    Daniel

    ------------------------------
    CABERO Daniel
    Lead of IT R&D Lidea
    LIDEA France
    MONDONVILLE FR
    ------------------------------



  • 4.  RE: Working with an API with Uniface

    Posted 05-22-2022 05:16
    Edited by Gianni Sandigliano 05-23-2022 03:56

    Hi Daniel,

    you could experiment with UHTTP on free API, like those available in this page.

    They require "NO key" to access their services; in a later stage you could enlarge your experiment to other sites including user access rules (SFA, MFA, ...).

    Regards,
    Gianni



    ------------------------------
    Gianni Sandigliano
    IT
    ------------------------------



  • 5.  RE: Working with an API with Uniface

    PARTNER
    Posted 05-23-2022 04:15
    There is an example of communication with a REST service using UHTTP on the community downloads section. "Uniface UHTTP: Uploading files to Onedrive and downloading files from Onedrive"



    ------------------------------
    Iain Sharp
    Head of Technical Services
    Pci Systems Ltd
    Sheffield GB
    ------------------------------



  • 6.  RE: Working with an API with Uniface

    Posted 05-21-2022 14:27

    Hi Daniel,

    Iain has already properly answered you when Uniface is acting as an API client, consuming services supplied from other websites.
    If you need to implement an API server into your web system you need to build your API using USPs or DSPs.

    Hope it helps.

    Regards,
    Gianni



    ------------------------------
    Gianni Sandigliano
    IT
    ------------------------------



  • 7.  RE: Working with an API with Uniface

    Posted 05-23-2022 16:16
    Hi Daniel,

    Outbound from Uniface - use UHTTP - header / userid / passwords can all be set up as value lists and sent via Uniface.
    Inbound to Uniface - you'll need to get a Web Application license which sits as a front end to Uniface.  We use FRM components
        as the recipient of the inbound calls - we added operations to the FRM's and got it done that way as there was no percievd
        benefit in using USP's / DSP's.  We return json and xml -     and we don't use structs either...  We use a combination of json / xml
        with embedded "replacement" tags - fields/variables added into the json / xml using $expression and $replace..

    Regards,
    Knut

    ------------------------------
    Knut Dybendahl
    ------------------------------



  • 8.  RE: Working with an API with Uniface

    PARTNER
    Posted 05-24-2022 04:53
    The simple way, having an api over http(s) exchanging xml, json or what every you like. I can deliver uniface http request examples when needed. Using com you can write a connector to but imhop that's more complex (create dll, create signature, modify asn).

    ------------------------------
    Dino Seelig
    CTO
    Tcco
    Drunen NL
    ------------------------------