User Tools

Site Tools


cobi.wms:postman

This is an old revision of the document!


Troubleshooting with Postman

If you're getting an error message from the SAP Business One Service Layer API despite everything being configured correctly, you can make use of the free-of-cost tool Postman to make sure that the issue is not caused by COBI.wms:

https://www.postman.com/downloads/

Once you've installed and started the program for the first time, you can skip the account creation process by clicking the small button at the bottom of the login screen of Postman.

Afterwards you can import this Service Layer Collection file into Postman: servicelayer.postman_collection.json

(To open the Import screen of Postman, go to File → Import or press Ctrl + O.)

For the Service Layer collection to work, you have to create an Environment in Postman. You can open the Environments tab from the left side of the Postman window to create a new one.

You can name the environment however you like, for example “Service Layer.” You must then add the following variables:

Name Value
SLROOT The Service Layer base-URL, such as: http://sbo-server:50001/b1s/v1
COMPANY The name of the SAP Business One company database to which you want to connect
USERNAME The username of a valid SAP Business One user
PASSWORD The password of the SAP Business One user

Note: If any value contains a back-slash “ \ ” symbol in it, you have to duplicate each back-slash to be two back-slashes. For example if the username is “MyDomain\testuser” then you must write “MyDomain\\testuser” instead. (This does not apply to forward-slash “ / ” symbols, only back-slashes. And it is not needed in the COBI.wms Android App, only in Postman.)

After saving the environment, you have to activate it by selecting it from the drop-down towards the top-right corner of the Postman window, where it normally says No Environment.

You can then open the Service Layer collection by opening the Collections tab from the left side of the Postman window, and choosing Service Layer.

If you've done everything correctly, you should be able to select the POST Login request in the Service Layer collection and click on the blue Send button to test the login process.

A successful login to Service Layer will yield an output such as the following:

{
  "@odata.context": "http://192.168.178.254:50001/b1s/v2/$metadata#B1Sessions/$entity",
  "SessionId": "878d6bfc-e06e-11eb-8000-000c29fb30d8",
  "Version": "1000150",
  "SessionTimeout": 60
}

Afterwards you can try some of the other requests. For example, the POST Attachment Upload request can be used to see if uploading file attachments is working fine. A successful attachment upload will result in a response such as the following:

{
  "@odata.context": "http://192.168.178.254:50001/b1s/v2/$metadata#Attachments2/$entity",
  "AbsoluteEntry": 7,
  "Attachments2_Lines": [
      {
          "SourcePath": "C:\\Windows\\TEMP\\ServiceLayer\\Attachments2/",
          "FileName": "my_photo",
          "FileExtension": "png",
          "AttachmentDate": "2021-07-09",
          "Override": "tNO",
          "FreeText": null,
          "CopyToTargetDoc": "tNO"
      }
  ]
}
cobi.wms/postman.1627293754.txt.gz · Last modified: 2021/07/26 12:02 by tkammer

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki