Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
McJingles
Contributor III
Contributor III

tREST component with DELETE method

Hi,

I tried to do the DELETE operation using the tREST component. But, If I choose the DELETE method then the HTTP Request Body was disappeared. But in my API, I need to pass a few information in the form of JSON as Body Parameters. Please help here or suggest any alternate solution.

Thanks in advance

Labels (4)
1 Solution

Accepted Solutions
McJingles
Contributor III
Contributor III
Author

I used the tSystem component and curl like below and I got the expected output.

 

curl -i -X DELETE \"https://api-d.docusign.net/management/v2.1/organizations/{{ORG_ID}}/accounts/{{ACC_ID}}/products/users\" -H \"Content-Type: application/json\" -H \"Authorization: Bearer <TOKEN>\" -d \"{\\\"user_email\\\": \\\"jhbsvjhbshb\\\",\\\"user_id\\\": \\\"kjdvkjdhvdd\\\",\\\"product_ids\\\": [\\\"dkhbfkvjdb\\\"]}\"

 

 

View solution in original post

5 Replies
Anonymous
Not applicable

Hello @McJingles McJingles​ ,

HTTP DELETE requests, like GET and HEAD requests, should not contain a body, as this may cause some servers to work incorrectly. But you can still send data to the server with an HTTP DELETE request using URL parameters

For your case, please use URL parameters to send the data in tREST component.

 

see https://reqbin.com/req/ke7ui8ri/http-delete-body

 

Best regards

Aiming

 

McJingles
Contributor III
Contributor III
Author

Thanks for your response @achen (Talend Beijing Tech Co., Ltd.)​ 

 

Can you please let me know in detail how can I implement it in Talend?

 

More info -

URL - https://api-d.docusign.net/management/v2.1/organizations/{{ORG_ID}}/accounts/{{ACC_ID}}/products/users

Path parameters - ORG_ID, ACC_ID

Body parameters -

{

 "user_id": "skjrdsgkndglkg",

 "product_ids": [

  "kishgvkjvd"

 ]

}

 

 

The path parameters can bind within the URL automatically. But how can I pass the body parameters?

Anonymous
Not applicable

Hello @McJingles McJingles​ ,

The URL should be like

 https://api-d.docusign.net/management/v2.1/organizations/{{ORG_ID}}/accounts/{{ACC_ID}}/products/users?user_id=xxxxx&product_ids[]=xxxx

McJingles
Contributor III
Contributor III
Author

After formatting like the above URL, I got the below error. Moreover, this is the same error I got from the beginning.

 

BODY -

{

"error":"invalid_request",

"error_description":"Data must be provided in the request body",

"reference_id":"3197"

}

ERROR_CODE - 400  

McJingles
Contributor III
Contributor III
Author

I used the tSystem component and curl like below and I got the expected output.

 

curl -i -X DELETE \"https://api-d.docusign.net/management/v2.1/organizations/{{ORG_ID}}/accounts/{{ACC_ID}}/products/users\" -H \"Content-Type: application/json\" -H \"Authorization: Bearer <TOKEN>\" -d \"{\\\"user_email\\\": \\\"jhbsvjhbshb\\\",\\\"user_id\\\": \\\"kjdvkjdhvdd\\\",\\\"product_ids\\\": [\\\"dkhbfkvjdb\\\"]}\"