bluehorseshoe 0 Report post Posted September 27, 2019 When placing new trades, I keep getting the 401 Unauthorized error. I can authenticate and I have confirmed marketId and marketName. What is wrong with this body that I am passing? { IfDone = [], Type = null, Applicability = null, ExpiryDateTimeUTC = null, OcoOrder = null, Direction = BUY, isTrade = True, TriggerPrice = null, AuditId = null, Currency = null, MarketName = EUR/USD, BidPrice = 1.09417, ExpiryDateTimeUTCDate = null, PositionMethodId = 1, LastChangedDateTimeUTCDate = null, AutoRollover = False, Status = , MarketId = 401484347, OfferPrice = 1.09431, LastChangedDateTimeUTC = null, OrderId = 0, Quantity = 1000, QuoteId = null, TradingAccountId = xxxxxxx} Share this post Link to post
Physicsman 26 Report post Posted September 30, 2019 Hello, Are you sending your User Name and Session token in the header of your calls? They are required as authentication in all calls made to the API. The HTTP 401 code indicates that the request has not been applied because it lacks valid authentication credentials. Kind Regards, PM Share this post Link to post