Skip to main content
Solved

API call ProductStructureHandling giving an "Invalid key value" error for the parameter "BomType"


Forum|alt.badge.img+2

I am trying to fetch the product structure items by passing six required parameters as shown below API call. This is as per the API Doc and am using PostMan with a valid bearer token.

 

https://w.sandbox.maiaspace/main/ifsapplications/projection/v1/ProductStructureHandling.svc/ProdStructures(Contract='{Contract}',PartNo='{PartNo}',EngChgLevel='{EngChgLevel}',BomType='{BomType}',AlternativeNo='{AlternativeNo}',LineItemNo={LineItemNo})

 

 

i am getting this error message, even though i put the required element 

{

    "error": {

        "code": "REQUEST_ERROR",

        "message": "Malformed Request.",

        "details": [

            {

                "code": "INVALID_KEY_VALUE",

                "message": "The key value 'BomType' is invalid."

            }

        ]

    }

}

BomType

Manufacturing

I am on IFS Cloud 23R1.

Best answer by Tomas Ruderfelt

Since BomType is an enumeration you need to specify it like this in the URL to “ProductStructureHandling.svc/ProdStructures”:

…,BomType=IfsApp.ProductStructureHandling.ShopOrdCode'Manufacturing',...

View original
Did this topic help you find an answer to your question?

5 replies

Forum|alt.badge.img+10
  • Hero (Partner)
  • 190 replies
  • December 7, 2023

Can you add the input json and add odata-debug=json as a parameter?
 


As now we are flying a bit blind


Forum|alt.badge.img+2
  • Author
  • Sidekick
  • 6 replies
  • December 7, 2023

Hello 

thank you for your answer

here is the rpart of the request to the odata-debug

 "request": {

        "method": "GET",

        "uri": "https://xxxxxxx/main/ifsapplications/projection/v1/ProductStructureHandling.svc/ProdStructureHeads(Contract='TEST1',PartNo='L1',EngChgLevel='1',BomType='M')?odata-debug=json",

        "protocol": "HTTP/1.1"

    },

    "response": {

        "status": {

            "code": "400",

            "info": "Bad Request"

        },

        "headers": {

            "OData-Version": "4.0",

            "Content-Type": "application/json"

        },

        "body": "{\"error\":{\"code\":\"REQUEST_ERROR\",\"message\":\"Malformed Request.\",\"details\":[{\"code\":\"INVALID_KEY_VALUE\",\"message\":\"The key value 'BomType' is invalid.\"}]}}"

    },

    "server": {

        "stacktrace": {

            "exceptions": [

                {

                    "class": "org.apache.olingo.server.core.uri.parser.UriParserSemanticException",

                    "message": "Value of key 'BomType' for entity 'IfsApp.ProductStructureHandling.ProdStructureHead' is not valid.",

                    "invocation": {

                        "class": "org.apache.olingo.server.core.uri.parser.ParserHelper",

                        "method": "keyValuePair",

                        "line": 450

                    }

                }

            ]

 

Does this help?


Forum|alt.badge.img+20
  • Superhero (Employee)
  • 492 replies
  • Answer
  • December 7, 2023

Since BomType is an enumeration you need to specify it like this in the URL to “ProductStructureHandling.svc/ProdStructures”:

…,BomType=IfsApp.ProductStructureHandling.ShopOrdCode'Manufacturing',...


Forum|alt.badge.img+20

That can be found in the metadata:

<Your URL>/main/ifsapplications/projection/v1/ProductStructureHandling.svc/$metadata

Forum|alt.badge.img+2
  • Author
  • Sidekick
  • 6 replies
  • December 7, 2023

Thank you so much for you help 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings