I am trying to post a new ticket using the API but I am getting the following error:
{“status”=>“error”, “message”=>“Cannot create object with type: 0-5. The following required properties were missing: [hs_pipeline_stage]”, “correlationId”=>“a2a9b224-486f-477b-8217-6a1e1f0ce7f8”, “requestId”=>“e6504956-b53b-4e96-bab2-0c4bc8c75492”}, @response=#<Net::HTTPBadRequest 400 Bad Request readbody=true>, @headers={“date”=>[“Mon, 18 Nov 2019 17:28:03 GMT”], “content-type”=>[“application/json;charset=utf-8”], “content-length”=>[“241”], “connection”=>[“close”], “set-cookie”=>[“__cfduid=dc83d4ba4944be0ea57eae6c7fa890b531574098083; expires=Tue, 17-Nov-20 17:28:03 GMT; path=/; domain=.hubapi.com; HttpOnly”], “x-trace”=>[“2B23EF591939488C8A51F64F3CD7AAAD4EFE0EAF7A000000000000000000”], “vary”=>[“Accept-Encoding”], “access-control-allow-credentials”=>[“false”], “cf-cache-status”=>[“DYNAMIC”], “strict-transport-security”=>[“max-age=31536000; includeSubDomains; preload”], “expect-ct”=>[“max-age=604800, report-uri=\”[https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\\](https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\)“”], “server”=>[“cloudflare”], “cf-ray”=>[“537ba8a08c15cf50-IAD”]}
Here is the code I am running:
response = HTTParty.post(“https://api.hubapi.com/crm-objects/v1/objects/tickets?hapikey=REDACTED”, { :body => [ { subject: “test ticket from Aaron”, content: “This is some content”, hs_pipeline: “0”, hs_pipeline_stage: “1” } ].to_json, :headers => { ‘Content-Type’ => ‘application/json’, ‘Accept’ => ‘application/json’} })