1

I'm trying to reach SAP Business One Service Layer APU via PostMan and Python (with requests module). However, when I try to POST to /Login endpoint to our Service Layer it gives me the following JSON result:

{ "error": { "code": -304, "message": { "lang": "en-us", "value": "" } } }

As you can see, it's an error code -304 with an empty message value.

The payload I'm sending is a text like this:

{"UserName":"my_username","Password":"my_password","CompanyDB":"NAME_OF_MY_DB"}

I have tried this payload as well to /Login enpoint but with no successful result:

{"Username":"my_username","Password":"my_password","CompanyDB":"NAME_OF_MY_DB"}

but this results in this JSON result:

{ "error": { "code": 102, "message": { "lang": "en-us", "value": "Invalid login credential." } } }

Can anyone, please, suggest what may be wrong here? I need to Login and then GET the Items from the DB.

Thank you in advance

2
  • A couple of things to check: If the platform is Hana, have you run out of disk space? Have the SL worker processes stopped (try restarting service). Is the MIME type on your request correct?
    – Daz
    Dec 21, 2020 at 9:15
  • Thanks @Daz . What should the MIME type be? I'm using application/json.
    – neisor
    Dec 22, 2020 at 10:07

1 Answer 1

1

The issue was that I needed to use a domain before the username. So, at the end, the working payload looks like this:

{"UserName":"my_domain\\my_username","Password":"my_password","CompanyDB":"NAME_OF_MY_DB"}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.