Loading...

Get Started with the API

Comments

21 comments

  • Paul Heairfield

    Is there a document that describes the object models and entity relationship?

    e.g. In InvoiceDetails what is the difference between UnitCharge, ExtendedCharge, TriangulationCurrencyUnitCharge, TriangulationCurrencyExtendedCharge, FCExtendedCharge, etc...?

    e.g. How do Invoices relate to Events, Accounts, GLAccounts & JournalEntryDetails, etc?

  • Phil barker

    Thanks again Rudy!

  • Rudy Scoggins

    Hi Phil,

    Since RelationshipType is used to identify the relationship entry, there is no way to change it.  You will have to remove the entry and add a new one.

  • Simon Dargaville

    Ah ha !  I had to add 'headers=' to my get request and now it's working!  Thanks Steve for making me check the header was right ! - 

    I was using r = requests.get(url, headers)

    Not 

    r = requests.get(url, headers=headers)

    This works.

  • Simon Dargaville

    Hi, I'm just doing some initial testing and I can run queries OK via <our url> api/help/ web page using my own credentials, but when I try to run my python code (using same credentials)  I get

    {"Message":"Authorization has been denied for this request."}

    Is that a sign there's something not right with my code, or could it be that my user account is not be able to access the API ? 

    I seem to be able to receive a Token ok, but also I notice my code sends the token in percent-encoded form, does that look ok?

    (I'm reusing some existing python code that does work ok, just not sure why it doesn't work with my creds)

     

    received token = DQKdszMbKVCrPgvyrIncOfUm1efnBLeg6CvH6JDGry4lDQPjqjwt1o2oPBCZmyeXciLl9tGLKLH9E/jXQ0EWn4eIraqc7CQp8Hq9ZYroa1n/OB9ghUXzstkrZZscCyC5MqZKWtazVFCXeIIYf0xnEg==

     

    response.url=

    https://URL/api/v1/Functions/10/58529/8?TOKEN=DQKdszMbKVCrPgvyrIncOfUm1efnBLeg6CvH6JDGry4lDQPjqjwt1o2oPBCZmyeXciLl9tGLKLH9E%2FjXQ0EWn4eIraqc7CQp8Hq9ZYroa1n%2FOB9ghUXzstkrZZscCyC5MqZKWtazVFCXeIIYf0xnEg%3D%3D

     

     

  • Rudy Scoggins

    Hi Phil,

    Yes, that would be the way to go.  It's typically part of the standard web.config on installation.

    You'll also need the following entries for our API Help page:

    <location path="swagger">
    <location path="api/help">
    <location path="UPI/CustomContent">

  • Rudy Scoggins

    Hi Steve,

    The Ungerboeck.Integrations.dll was primarily used for webhooks, which is given under Ungerboeck.Webhooks.  Was there a use beyond this you needed it for?

  • Phil barker

    We have two v20 websites connected to the one production database - UBPROD and UBPRODAUTH.

    UBPROD is configured with Windows Authentication and UBPRODAUTH with Ungerboeck Authentication. 

    I can use the API's through the Swagger interface when logged into UBPRODAUTH with USI_API user.

    When I try to access the sdk_initialize API on UBPRODAUTH (Ungerboeck Authentication) - through Postman or a C# client - I am always challenged with the Ungerboeck Sign In page.

    When I try to access the sdk_initialize API on UBPROD (Windows Authentication) - through Postman or a C# client - it always returns 401 Unauthorised.

    I can log into SQL and Ungerboeck with the same USI_API credentials.

  • Rudy Scoggins

    Hi Package User!

    The SDK was built with .NET Framework 4.7.2.  You can do a few things to help this, starting with changing the application's framework.  Make sure to clear the Nuget cache inside visual studio as well (Tools->Nuget Package Manager->Settings->General->Clear Cache

  • Phil barker

    Is there a way to update the RelationshipType on a Relationship using the PUT method of the endpoint

    api/v1/Relationships

    I am getting the following error message
    Relationship 'RelationshipType' value in request body does not match URI parameter

  • Hey Phil, is anonymous authentication enabled for the site in IIS?

    Even if you've missed the auth heading or got the base64 encoding wrong, you should still get a response back like;

    {
        "Message": "Authorization has been denied for this request."
    }
  • Phil barker

    Thanks for your response Lee.

    Both websites have Mixed-Mode Authentication in IIS.

    UBPROD has Anonymous and Windows (401 Challenge) enabled, while UBPRODAUTH has Anonymous & Forms (SignIn.aspx) enabled.

    Anonymous Authentication is set to use IUSR and I've checked that user has been granted permissions on the Windows folders.

    When testing the API on UBPROD we get the 401 Challenge and when testing the API on UBPRODAUTH we get the SignIn.aspx page.

  • Phil barker

    Thanks for your reply Rudy.

    I have added the following to the web.config

    <location path="api/v1/sdk_initialize">
       <system.web>
          <authorization>
             <allow users="*" />
          </authorization>
       </system.web>
    </location>

    and I am now able to retrieve the token.

    However any subsequent API calls - e.g. api/v1/events/12/34567 - will still be challenged with the Ungerboeck Sign In page.

    Should I allow all users to access path "api/v1"? 

  • Steve Gilbey - ICC Sydney

    No. That was all. For some reason when I searched Nuget for Ungerboeck, I didn't see .Webhooks.

    Still 1.0.0 version, so I don't need to update. Thx

  • Craig Dudenhoeffer

    Hi Kris,

    Not sure if you're referring to the new authentication mechanism for the API.  If so, documentation will be available in the next 1-2 weeks within the same section of the Support Center.

    If not, if possible, I would still try to hold out for that documentation as this will be the way forward with API authentication.

  • Kris Corrigan

    Hi

    How can we create users for the API within Ungerboeck?

    Is there any documentation on this?

    Thanks

    Kris

  • Steve Gilbey - ICC Sydney

    I could be wrong, but I believe the token has to be in the header, not the URL. Only the parameters go in the URL. If the token is in the header, it won't get % encoded.

    That's what I've been doing and it works. 

  • Not really- just the data model you can access via the main menu.

    Last I checked, it has useful descriptions for some columns and notes of joins to other tables, but not much more than that.

  • Steve Gilbey - ICC Sydney

    I am trying to start a new solution in VS2017 and when loading the SDK and API packages through NuGet and I am receiving the message:

    Could not install package 'Ungerboeck2096SDK 20.96.2.7'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

    Dear package author,
    Which Framework should I be targeting with the current SDK? 

  • Steve Gilbey - ICC Sydney

    Thanks Rudy. Got that set and the .96 SDK and wrapper referenced.

    Will you be putting Ungerboeck.Integrations.dll in either Git or Nuget?
    As I no longer have an up to date onprem install to get it from. I have downloaded 20.96E Latest browser .zip and extracted it from there for now, but I guess the day is not far off where we are all hosted and they aren't available for download any more. 

  • Rudy Scoggins

    Hi Phil,

    The Ungerboeck API doesn't support Windows Authentication, but your Ungerboeck Authentication site should work fine.

    Could you paste the exact URL you are using to access the API?  You don't need to paste any headers and can leave out the domain if you wish.

    A bit of behind the scenes to explain what's probably happening: Ungerboeck uses the <location path="x"> areas of the web.config in your server files to determine if the direct URL should be allowed, or if it should be denied and returned to the sign in page.  Without knowing more, my guess is either your URL isn't correct, or the web.config is customized and maybe missing a key element.

    Rudy

Please sign in to leave a comment.