Jump to content
  • 0

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


Guest sam4

Question

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. 

Link to comment

4 answers to this question

Recommended Posts

  • 1

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
Link to comment
  • 0
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

Link to comment

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

    • It has to be honest, especially my humble self & I think the price trend of BTC is gonna be promising which could prolly make me a millionaire, having invested in it.
    • OMNI could be the next big gem in the crypto market & I'm not gonna let it slide through my finger to hold long-term for a good ROI
    • Interoperability: Different blockchain networks follow distinct protocols and rules, making it challenging for them to communicate and share data/assets effortlessly. This creates isolated ecosystems that struggle to interact smoothly. For instance, if a blockchain supply chain system needs to exchange information with a finance blockchain to process payments, the lack of interoperability complicates the process significantly. Scalability: Scalability refers to a blockchain's ability to handle increasing numbers of users and transactions without performance degradation. Many popular blockchains, such as Bitcoin and Ethereum, face scalability challenges. They require every node to validate each transaction, limiting their transaction processing capacity. As more users join or transaction volumes rise, the network becomes congested, leading to slower speeds and higher fees. This scalability issue hinders blockchain's use for high-traffic applications like global payment systems or decentralized apps (DApps). To address these challenges, researchers are working on solutions such as: For interoperability - developing standard protocols or "bridges" that enable seamless communication between different blockchains. Examples include Polkadot, Cosmos, and Nervos. For scalability - approaches like sharding (dividing the blockchain into smaller pieces to process transactions in parallel), off-chain scaling (conducting some transactions off the main chain), and others. The Nervos Network, a Layer 1 and 2 blockchain, aims to tackle interoperability and scalability issues using its Proof-of-Work consensus and tools like the Universal Passport for creating "Universal Applications" that can function across different chains. Overcoming these hurdles is crucial for mainstream blockchain adoption, enabling smooth integration with existing systems, high transaction volumes, and interconnected decentralized applications across multiple blockchain networks.
×
×
  • Create New...
us