Login

How to login to BxEngine API

Request

BaseUrl

https://api.bxsoftware.no/

LoginURL

https://api.bxsoftware.no/1.0/Login

HTTP Method

POST

HTTP Body

{"username":"testuser","password":"123","companycode":123456}

 

Response Success

HTTP Code

200

Session info in http header

set-cookie: BxSID=00000aaaaAAAA000000; expires=Tue, 14 Mar 2017 12:39:06 GMT; path=/; httponly

Message in HTTP Body - User Info

{"success":true,"totalcount":1,"message":"","error":"","data":[{"userid":1,"username":"testuser","fullname":"Test User","accesslevel":"User","warehouse":"","erpuserid":0,"erpusername":"","employee":0,"profileid":1,"profilename":"Standard","companyname":"Standard","bxsid":"00000aaaaAAAA000000","companycode":"123456","companyid":1,"serverversion":"4.0.816.0","password":null,"serveripaddress":"123.123.123.123"}]}

 

Response - Failure - CompanyCode not online or does not exist

HTTP Code

404

HTTP Body

{"success":false,"totalcount":0,"message":"","error":"<Error><Code>404</Code><Detail>No service is hosted at the specified address. TrackingId:7618104a-836d-4986-b587-2478c075aa8e_G8, SystemTracker:bxsoft.servicebus.windows.net:1233333/1.0/Login, Timestamp:3/13/2017 12:51:08 PM</Detail></Error>","data":[]}

 

If the company id is correct, med 

{"success":false,"totalcount":0,"message":"","error":"Unauthorized","data":[]}

 

Response - Failure - Invalid user/password for companycode

HTTP Code

401

HTTP Body

{"success":false,"totalcount":0,"message":"","error":"Unauthorized","data":[]}

 

Usage

Get the BxSID from cookie or from the bxsid user json object. Notice that the data property is always an array for all our 1.0 and 2.0 rest services, when using /Login is will only contain one record.

All request to our rest api requires BxSID sent as a cookie parameter. eg:

GET 12182/1.0/products/ HTTP/1.1
HOST:  api.bxsoftware.no
COOKIE: BxSID=00000aaaaAAAA000000