Loading...

Search Using the API

Comments

36 comments

  • David Glock

    Hi Sven, thanks a lot for your reply. Now it worked for me. I tried the api calls with postman and not through the api help page. Thanks for the advice. 

    One more addition to my problem with single qoutes. The answer from Lee was correct. I noticed, that in the name I was searching in the database it wasn't used a single quote but an apostrophe (´) .

  • Lee Tickett (Tickett Enterprises Limited)

    I am 👋

    Not sure if you mean Momentus staff specifically though :)

  • Sven Mannherz

    If the page_size can be reproduced, I suggest submitting a support ticket. This allows our product team to review why this is happening with your database.

  • Phil barker

    Hello. I am having trouble using the POST method of the JournalEntryDetails API endpoint.

    The JournalEntry (Purchase Accrual) is created successfully but the POST JournalEntryDetails with payload similar to below

    {"Organization":"10",
    "Year":2023,
    "Period":10,
    "Source":"PA",
    "EntryNumber":"0000804",
    "Status":"N",
    "Date":"2023-11-17T14:23:08.773Z",
    "Description":"Big Chairs",
    "Amount":52080.0000,
    "GLAccount":"0102033304567",
    "Reference":"PO_ID 10204054",
    "Event":12345,
    "Account":"01010203",
    "Department":"1234"}

    fails with error
    -- System.ArgumentNullException: 'column' argument cannot be null.Parameter name: column at System.Data.DataRow.CheckColumn(DataColumn column) at System.Data.DataRow.get_Item(DataColumn column) at Ungerboeck.Common.StdFuncs.GetDateColumnValue(DataRow arow, String astrColumnName, DataRowVersion aobjModifiedRowVersion, DataColumn aobjColumn, Boolean& ablnIsNull) in C:\AzureBuildAgents\USSTL-PATCH_1\_work\4\s\Base Services\USIBAS00\stdfuncs.vb:line 9036 at Ungerboeck.Common.StdFuncs.GetDateColumnVa...

    Any help or suggestions would be greatly appreciated. Thank you.

  • Chris Jolly

    Anybody still watching this thread?

  • Sven Mannherz

    Hi David, thanks for the update. In such a case, I recommend extracting the name from the software and running it through URL Encoding if not returned via an API search. As this will always give you more details on the character used by the user, there is always the option for a user input error.

  • David Glock

    Thanks for your reply. I tried it but did not work for me.

  • Chris Jolly

    (contains(Space, 'EXH') or substringof('EXH', Space) or indexof(Space, 'EXH') gt -1) Note that OData syntax is case sensitive. --Error: An unknown function with name 'contains' was found. This may also be a key lookup on a navigation property, which is not allowed.","Source":"ListData"}]}

  • Sven Mannherz

    Hi Markus, I would recommend the following article on searching using the API: https://supportcenter.ungerboeck.com/hc/en-us/articles/115010610608-Search-Using-the-API

    The "search=true" parameter is not supported. If you need assistance in building the search query, please reach out to your account manager to schedule a training session.

  • Lee Tickett (Tickett Enterprises Limited)

    Can you try contains(Space, 'EXH') or substringof('EXH', Space) or indexof(Space, 'EXH') gt -1

    I'm not at my desk at the moment, but if you can't get it working, let me know and i'll figure it out- i'm sure i've done it before.

  • Chris Jolly

    Well maybe if we have a conversation somebody will know. I'm trying to search a field and need to figure out how to do a wildcard or similar. So currently searching with this format: {base_url}Bookings/{ORG_CODE}?search=StartDate ge DateTime'{formatted_current_date}' and Status eq '30' or Status eq '21' and (Space eq 'EXHA1' or Space eq 'EXHA2'or Space eq 'EXHA'or Space eq 'EXHB' or Space eq 'EXHC' or Space eq 'EXHD' or Space eq 'EXHA-B' or Space eq 'EXHA-C' or Space eq 'EXHA-D' or Space eq 'EXHB-C' or Space eq 'EXHB-D' or Space eq 'EXHC-D') since I could not figure out how to search for Space starting with "EXH". I tried Space eq 'EXH%' but this did not work. Any ideas how to return any Space the starts with "EXH" ???

  • Sven Mannherz

    Hi David, as the search parameters are used in the URI, you need to use URL Encoding. 

    • ö -> %C3%B6
    • ä -> %C3%A4
    • ü -> %C3%BC

    Example, searching for an Account with the First Name 'öäü'

    • [Ungerboeck URI]/api/v1/Accounts/10?search=FirstName eq '%C3%B6%C3%A4%C3%BC'

    The API help page should be encoding the values for you, in case you already have challenges at this stage, we recommend creating a Support Case, or if you want to have a technical discussion, your Account Manager can set up a meeting with a Solution Developer.

  • Rudy Scoggins

    Hey Lee,

    Yeah, this would be an opt-in property for the Select parameter.

    search=Year eq 2005$select=[JournalEntryDetails]

    Check out this example for more info.

    Thanks,
    Rudy

  • Markus Kolp

    I'm using page_size and page as parameter, but the result is always the same. No matter whether I set the page_size e.g. to 100 oder 1000.

    what am I doing wrong?

    e.g. /api/v1/Events/10?search=true$page_size=100

  • Rudy Scoggins

    Hi Phil,

    I have submitted this bug to our development department to fix.  It should show a more informative message.

    In the meantime, my quick tests show this error might occur if the EntryNumber value isn't found.  Can you double check if it exists and try again?

    Rudy

  • Lee Tickett (Tickett Enterprises Limited)

    Hi Rudy,

    The API docs show that JournalEntries model includes the journal entry details. When we've tested it, we don't seem to get the details back.

    Do we need to do something special to get them?

    Thanks

    L

  • Craig Dudenhoeffer

    Currently the API returns the full model with no options to retrieve just the fields you want.  This is already on our backlog to address.

  • Rudy Scoggins

    Hi Bryan,

    This link to an example might help you.  It will show you a function that has an example of searching for User Fields on an opportunity.

    Rudy

  • Rudy Scoggins

    Hi John,

    Not directly. You would need to perform a followup GET for the account information.

  • Carlos Chan

    Has anyone tried $select? I tried but it does not work. I am on API v1.

    Or if there is another way to reduce the number of fields to return?

    Edit: I am just trying through API Help.

  • Theresa Gorman

    Is there a way to return the event logo using API EV200_EVT_LOGO

    We have tried but it does not find the field

  • Craig Dudenhoeffer

    Kate - Yes, please take a look at this article:  https://supportcenter.ungerboeck.com/hc/en-us/articles/360012928934-Customize-the-API-with-the-select-Operator-for-Custom-Objects

    This will let you get only what you want want returned within an object.  As an example, the 'Event' model has around 100 properties.  Using the new feature you can return an Event object with only 3 properties if you wish.  It will always return primary key columns regardless of what you specify.

    Also, please consider using this when editing items as well, as you'll get a performance bump since we do not have re-fetch the entity being edited.

    Thanks,
    Craig

  • Lee Tickett (Tickett Enterprises Limited)

    I think you escape single quotes with an additional single quote. So: 

    LastName eq 'O''Leary'
  • David Glock

    Hello. I'm having problems with searching for accounts with special characters in the name. How do one encode characters like Ä,Ö,Ü,ß to make an call with the Ungeboeck API? I tried it with the unicode (utf-8) with several different escaping characters, but nothing worked.

    • \u00d6
    • \\u00d6
    • $u00d6
    • &u00d6

    Further how can I escape single quotes in the search string?

    Has anyone a clue how to get around this problems?

    Thanks for any advice.

    David

  • Lee Tickett (Tickett Enterprises Limited)

    Hero- works a treat- thanks Rudy!

  • Markus Kolp

    Hi Sven, thanks for the quick response. But my problem was not "search=true" (actually search=all gives the same results). But thanks for the right syntax.  ---   My problem is the page size parameter: it just doesn't work. I always get the same result, no matter if I set the page size to 1, 100, 1000, etc. ?

  • Phil barker

    Thanks for looking into this Rudy and for progressing it to the development team.

    I can confirm that the EntryNumber is valid, having just previously successfully created the Journal Entry.

  • Lee Tickett (Tickett Enterprises Limited)

    Did you try them "all together" or each on their own?

    I meant them as different options, not to be used together :)

    I just tested and this works for example:

    https://abc.ungerboeck.com/test/api/v1/Accounts/10?search=substringof(%27Tick%27%2C%20LastName)
     
  • Kate Lee

    Has this been addressed yet?

  • Rudy Scoggins

    Hi Theresa,

    There currently is not.  You can see the available event fields on the event model in your API help page.

Please sign in to leave a comment.