on 2021 Jan 10 9:08 AM
Hello everyone,
I am using the Catalog Content API with the get request
/catalogname/{CatalogName}/supplierid/{SupplierId}/items
Now I want to filter my API response for some items using the rsql filter.
In my response I have the field "ShortName" with a String.
Now I want to use my filter to look for a single word.
This is my current code:
rsqlfilter=ShortName==("mouse")
I also tried it with *wildcards but it doesn't working.
Do you know a solution?
Best regards
Lukas
Yes, I tried to look for an item containing a word with a like operation. Too bad it is not possible.
Thank you for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi lukas_schoeneberger70 ,
In your code, the casing of ShortName is not the same as the casing in the field. It needs to be ShortName and not Shortname. Field names are case sensitive.
Also, there is no need for the parenthesis for the equality operator. Your condition should be ShortName==mouse. You only need to include double quotes when there is a space in the value provided.
Can you try updating the field name casing and updating the condition above and let us know if that fixes the issue.
Regards,
.A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Antonio,
this was a spelling mistake in my question, my bad. I entered the name correctly in the request.
I tried the solution you suggested but unfortunally it is not working.
I have also field for a "ManufacturerPartId" which has the value "M000018" for example.
With the following code it's possible to filter for this item.
rsqlfilter=ManufacturerPartId==("0018")
lukas_schoeneberger70 I tried filtering by ShortName and it is working on my end (see request below). I'm able to retrieve an item that matches that ShortName.
From reading your question again, I imagine that you are trying to use rsql to retrieve all items that contain a word..... in this case mouse. Is that correct? If so, you are trying to use the == operator as a tradition SQL like right? If that's the case, like operations don't seem to be supported in the API, at least for ShortName. There is no operator that supports "likes" and it is only possible to use == (match) in this case. That being said, as you correctly mentioned before... it seems that for ManufacturerPartId and SupplierPartId it is possible to use == as a like operator. All you need to specify is at least three characters and it will work, e.g. SupplierPartId==("A2C").
curl --location --request GET 'https://openapi.ariba.com/api/catalogcontent/v1/prod/catalogname/MyCatalog/supplierid/buyersystemid:0000037001/items?select=ShortName,ManufacturerPartId,Description,SupplierId,SupplierName,SupplierPartId,Price.Amount,Price.Currency.UniqueName,UnitOfMeasure,ManufacturerName&rsqlfilter=ShortName==(%22DISPENSER,F/310AN,PNOTES%22)&offset=0&limit=1000' \
--header 'realm: myrealm-T-T' \
--header 'Authorization: Bearer be07ad0b-1234-5678-af5a-f6218d67475e' \
--header 'apikey: abcdefg12345678i4Hk00J6GttmObO'<br>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.