Forum Discussion

David91's avatar
David91
Frequent Contributor
2 years ago
Solved

POST request return 400 Bad request

Hi, I have a problem with a POST request to the server. Thanks to basic auth I managed to authenticate but the request still returns 400 Bad Request. Do you know what I am doing wrong. The same poin...
  • rraghvani's avatar
    2 years ago

    This will be difficult to diagnose, since 400 Bad Request response, indicates that the server cannot or will not process the request due to something that is perceived to be a client error.

     

    Saying that, it looks like your JSON is incorrectly formatted (shown in red),

     

    '{"extIsId":"abc/777","productCode":"ExterniKodSort","name":"TA_API777","type":0,"measurementUnitCode":"KS","weightGross":1.1,"weightNett":1.1,"grossDimension":{"height":1.1,"width":1.1,"depth":1.1,"volume":1.1},"pictureUrl":"www.aaa.cz/SORT.png","expirationMandatory":1,"serialNumbersRecords":{"inboundMandatory":1,"outboundMandatory":1},"batches":1,"barcodes":[{"barcode":123456,"active":1,"default":1,"measurementUnitCode":"ks"}]}surementUnitCode":"KS","warehouseCode":"3S20","weightGross":10.5,"weightNett":9.5,"grossDimension":{"height":2,"width":1.5,"depth":3.5,"volume":10.5},"pictureUrl":"","expirationMandatory":1,"serialNumbersRecords":{"inboundMandatory":1,"outboundMandatory":1},"batches":1,"barcodes":[{"barcode":"EAN80","active":1,"default":1,"measurementUnitCode":"KS"},{"barcode":"EAN81","active":1,"default":0,"measurementUnitCode":"KS"}]}';

     

     

  • David91's avatar
    David91
    2 years ago

    i use JSON.stringify and it works..