Jump to content
  • 0

Failing to Close deal with API validation.null-not-allowed.request


Guest sam4

Question

Posted

Hi, 

 

I'm making a Node.js program and just trying to open and close a position using the API. 

I'm making a delete request to 

https://demo-api.ig.com/gateway/deal/positions/otc

with the following data: 

{"direction":"SELL","size":1,"orderType":"MARKET","dealId":"DIAAAABNP77WXAT"}

and I'm getting back "validation.null-not-allowed.request" the weird thing is I try it with the api companion and it works.

Apparently the error means that something is malformed in the request but I've got absolutely no clue. I've tried changing size to be a string not an int, and I've tried using "_method":"delete" and making a post request as I've seen forum posts indicating that should work as an alternative to making a delete request but neither work. 

 

Any help would be greatly appreciated. 

4 answers to this question

Recommended Posts

  • 1
Posted

Apparently the DELETE request does not work.

You have to use a POST request instead. 

In the POST request, provide a header "_method" with the value "DELETE".

With curl you would specify the header as follows.

-H "_method: DELETE"

 

  • Like 1
  • 0
Posted (edited)

Hi there,

I have the same Issue than you but so long later. I would appreciate info about how did you manage to solve it.

Thx in advance

Edited by chucktrader
  • 0
Posted
On 15/07/2022 at 13:59, Argona said:

Apparently the DELETE request does not work.

You have to use a POST request instead. 

In the POST request, provide a header "_method" with the value "DELETE".

With curl you would specify the header as follows.

-H "_method: DELETE"

 

 

This worked for me thanks

  • 0
Posted

Blimey, I've spent the past day trying to get this to work and its been killing me! Just found this thread and changed my request to post and that was all it was. FFS, documentation should be better!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • image.png

  • Posts

    • A few days ago, I decided to take a deeper dive into staking options for my BTC. I came across the BGBTC pre-launch event, and after reviewing all the benefits, I knew I had to get involved. With the potential to earn passive income and gain BGPoints, it seemed like the perfect way to make my BTC work harder for me. The process was simple, and it immediately caught my attention that I could stake BTC and earn 2% APR, plus additional BGPoints. What’s even better is that BGBTC is offering multiple opportunities for growth. Not only can you earn from staking, but these BGPoints can be used for future token airdrops from different projects. I made sure to join the event on Bitget, where the process was straightforward. I staked my BTC, and now I’m already tracking my BGBTC holdings. If you have BTC sitting around, I’d recommend checking this out. The exchanger has made it incredibly easy, and the additional benefits like flexible trading options and enhanced security are just the cherry on top.
    • Congrats on the airdrop! The game’s community focus is definitely unique, and it’s exciting to see HoldCoin grow so much. Staking on PoolX sounds like a great way to make the most of those tokens—I’m curious too if others are planning to stake for those rewards.
    • Introducing $FROGE, the unofficial official mascot of OpenAI, blending $DOGE’s heart and $PEPE’s wit! Market Cap: $11M  Trading Volume: $16M+ Going live on BingX: Dec 13, 2024, 07:00 UTC This isn’t just another meme coin it’s a movement redefining what memes mean in crypto. Are you ready to ride the wave with $FROGE? #CryptoMemes #FROGE #BingX
×
×
  • Create New...
us