Create New Ticket - API Failed with 502 Bad Gateway

I tried to make an API Call for Creating an API through Curl. While using the curl command in this format:

  

curl -v -u <my-token>:X -H "Content-Type: application/json" -d '{ /"description/": /"Details about the issue.../", /"subject/": /"Support Needed.../", /"email/": /“email@domain.com/", /"priority/": 1, /"status/": 2, /"cc_emails/": [/"email@domain.com/",/"email@domain.com/"] }' -X POST 'https://<my-domain>.freshdesk.com/api/v2/tickets'

  I get the following errors: 

  

*   Trying <server-ip>:443...
* TCP_NODELAY set
* Connected to <my-domain>.freshdesk.com (server-ip) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=San Bruno; O=Freshworks Inc; OU=Freshworks; CN=*.freshdesk.com
*  start date: Jul  4 00:00:00 2017 GMT
*  expire date: Jul 14 12:00:00 2020 GMT
*  subjectAltName: host "<my-domain>.freshdesk.com" matched cert's "*.freshdesk.com"
*  issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High Assurance Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Server auth using Basic with user '<some-key>'
* Using Stream ID: 1 (easy handle 0x555c21469ba75)
> POST /api/v2/tickets HTTP/2
> Host: <my-domain>.freshdesk.com
> authorization: Basic <my-api-key>
> user-agent: curl/7.68.0
> accept: */*
> content-type: application/json
> content-length: 242
> 
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
* We are completely uploaded and fine
< HTTP/2 502 
< date: Wed, 05 Feb 2020 09:57:58 GMT
< content-type: text/html; charset=UTF-8
< content-length: 54
< status: 502 Bad Gateway
< cache-control: no-cache, no-store, must-revalidate
< x-fw-ratelimiting-managed: true
< x-ratelimit-total: 1000
< x-ratelimit-remaining: 999
< x-ratelimit-used-currentrequest: 1
< 
* Connection #0 to host <my-domain>.freshdesk.com left intact
<h2>Incomplete response received from application</h2>

Please help us.  


3 people have this question
1 Comment

Did you ever resolve this issue?  I'm also running into 502 Bad Gateway errors when making calls from an ASP.NET web application.  The same payload / auth combo works fine for me using Postman in testing.  I can't seem to understand the issue.


Login or Signup to post a comment