5
Answers

How to call a curl url or json

Photo of Dipika

Dipika

7y
231
1
curl -X POST -H "Authorization: Bearer kEnG562yz5bhE9igXf2YTcZ2bu0z" -H "Content-Type: application/vnd.api+json" -d '{ "jsonapi": { "version": "1.0" }, "data": { "type": "versions", "attributes": { "name": "drawing.dwg", "extension": { "type": "versions:autodesk.core:File", "version": "1.0" } }, "relationships": { "item": { "data": { "type": "items", "id": "urn:adsk.wipprod:dm.lineage:AeYgDtcTSuqYoyMweWFhhQ" } }, "storage": { "data": { "type": "objects", "id": "urn:adsk.objects:os.object:wip.dm.prod/980cff2c-f0f8-43d9-a151-4a2d916b91a2.dwg" } } } } }' "https://developer.api.autodesk.com/data/v1/projects/a.project.id.xyz/versions"
 
How to call dis?? m very much new to curl

Answers (5)

0
Photo of Dipika
NA 1.2k 14.6k 7y
my task is to upload file with updated version 6th step of following url
 
https://developer.autodesk.com/en/docs/data/v2/tutorials/upload-file/ 
0
Photo of Mitesh Gadhiya
NA 305 11.1k 7y
  1. var url = "API URL";  
  2. var jsonData = "[{...json data...}]";  
  3.   
  4. using (var client = new WebClient())  
  5. {  
  6.     client.Headers.Add("content-type""application/json");  
  7.     var response = client.UploadString(url, jsonData);  
 Try this
0
Photo of Dipika
NA 1.2k 14.6k 7y
I have to integrate this 
https://developer.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-versions-POST/ 
0
Photo of Dipika
NA 1.2k 14.6k 7y
What should i pass in query string or in request.AddHeader
0
Photo of Mitesh Gadhiya
NA 305 11.1k 7y
Please have a look at below thread it might be helpful to you:
 
https://stackoverflow.com/questions/7929013/making-a-curl-call-in-c-sharp