Solved

REST API call - Metadata Error

  • 24 September 2021
  • 7 replies
  • 970 views

Userlevel 6
Badge +12

Hey all,

I am trying to run a simple web API call using basic authentication against on-premise APPS10:

 

https://<server>:<port>/int/ifsapplications/projection/v1/PartsHandling.svc/PartCatalogSet(PartNo='MYPARTCODE')

 

I GET the above from POSTMAN and get the following error JSON returned:

 

{
"error": {
"code": "MI_METADATA_NOTFOUND",
"message": "Metadata not found."
}
}

 

There is another thread about this sort of thing from a year ago, but it was not resolved as far as I can tell. It may have something to do with me using int in the URL instead of main, but when I use main I get an authentication error. I’d like this to work with basic auth.

Can anyone enlighten me on what I am doing wrong, and what I should do differently? Better yet, where in the documentation can I better educate myself about proper syntax and projection names to overcome these sorts of errors? Every time I try to dive deeper into the RESTful API world I have trouble finding good examples of how to do things…

 

Thanks in advance!

Joe Kaufman

 

 

icon

Best answer by MiLeNL 27 September 2021, 09:17

View original

This topic has been closed for comments

7 replies

Userlevel 1
Badge +3

Hi Joe,

Are you using updated Headers values for the session in postman correctly? Sometimes it may cause

this kind of an error.

Thanks

 

 

 

Userlevel 4
Badge +10

Hi Joe,

 

If you want to use Basic Authentication you need to change a setting on Projection level via the API Explorer. The ‘Included in Compatibility Application type’ should be set to ‘Yes’. Else IFS will only allow authentication using OAuth2.

Change setting

 

After doing so, you will notice that the Basic Auth will start to work. 

Make Call

Else you will get the “Metadata not found” error which doesn't actually tell you what is happening. You can try to read up on the technical documentation which is located in <BaseUrl>/ifsdoc/f1doc and try searching in there.

Hope this helps!

Regards,

Mitchel

Userlevel 6
Badge +12

Mitchel,

Thanks! I made that change (which appears to immediately save), but still get the metadata error in a fresh Postman session as well as calling the URL straight from a browser and entering username/password from there.

Is there some sort of cache I need to clear or refresh?

Will head over to F1 help and see what I can find…

 

Thanks,

Joe Kaufman

Userlevel 6
Badge +12

Hi Joe,

Are you using updated Headers values for the session in postman correctly? Sometimes it may cause

this kind of an error.

Thanks

 

 

 

 

Kemal,

What headers in particular should I be concerned with, and what should their values be?

 

Thanks,

Joe Kaufman

Userlevel 4
Badge +10

Mitchel,

Thanks! I made that change (which appears to immediately save), but still get the metadata error in a fresh Postman session as well as calling the URL straight from a browser and entering username/password from there.

Is there some sort of cache I need to clear or refresh?

Will head over to F1 help and see what I can find…

 

Thanks,

Joe Kaufman

 

Hey Joe,

 

For me no cache refresh is required. All changes are reflecting right away. Also copy pasting the URL and giving in the user, shows me the data. If you change the compatibility settings, you should be able to navigate to the Documentation. (Notice, if you did not set compatibility you will only see the Main one).

 

In the documentation you can find the “PartCatalogSet”.

 

Copy pasting the URL which is provided over here (on the right) does not work either?

 

Regards,

Mitchel

Userlevel 6
Badge +12

Mitchel,

Thanks for sticking with me on this -- it was just a dumb mistake on my part. I was using “PartsHandling.svc” instead of “PartHandling.svc” (extra “s” in there) in the URL.

Once I corrected the typo I immediately got data back. 

Thanks for your patience and for walking through how effective actually looking at the documentation can be.  *smile*  The example URLs are especially useful. If only I had cut and pasted them instead of typing them out (thought I was “training” myself by manually typing), I probably wouldn’t have even needed to post this question!

 

Thanks.

Joe Kaufman

Userlevel 4
Badge +10

Mitchel,

Thanks for sticking with me on this -- it was just a dumb mistake on my part. I was using “PartsHandling.svc” instead of “PartHandling.svc” (extra “s” in there) in the URL.

Once I corrected the typo I immediately got data back. 

Thanks for your patience and for walking through how effective actually looking at the documentation can be.  *smile*  The example URLs are especially useful. If only I had cut and pasted them instead of typing them out (thought I was “training” myself by manually typing), I probably wouldn’t have even needed to post this question!

 

Thanks.

Joe Kaufman

 

Hey Joe,


Also didn't notice that small ‘s’, even though it was in your initial question :wink:. Such things happen to everyone once in a while. Good to hear that it works now!

 

Regards,

Mitchel