API submission returns wrong URL in JSON response

  • Profile Image
    prosci8
    Asked on July 17, 2019 at 02:18 AM

    Hello,

    When using a custom URL to access the API and doing a POST for a form submission, the returned JSON has the wrong URL in the response: 

    curl -X POST 'https://SUBDOMAIN.jotform.com/API/form/1234/submissions?apiKey=abcd' -d @data.json --header "Content-Type: application/json"

    I get back:

    {"responseCode":200,"message":"success","content":{"submissionID":"4391519528745704957","URL":"http:\/\/api.jotform.com\/submission\/4391519528745704957"},"duration":"495ms"}

     I expected to see :

    "URL":"http:\/\/SUBDOMAIN.jotform.com\/API\/submission\/4391519528745704957"

    Thank you for your time.

  • Profile Image
    roneet
    Answered on July 17, 2019 at 03:28 AM

    Do you want to see the URL in the response code?

    The response is defined to be in below Format. It returns an HTTPS code 200 which means that the request was received successfully.

    15633481411.PNG

    Let us know of you have further questions.

    Thanks.

  • Profile Image
    prosci8
    Answered on July 17, 2019 at 05:10 AM

    Thank you roneet, but I don't see how your reply relates to my question?

    I am referring to creating a new submission using a POST request where as your snippet of JSON is referencing a GET request to retrieve a submission.

    Either way, I was just trying to help the JotForm team by pointing out that the URL returned in the JSON response when POSTing a new submission does not cater for a client using their own domain, it instead returns the default JotForm domain "api.jotform.com". This is a tiny bug that can be fixed in the API.

    Regards,

    N


  • Profile Image
    jherwin
    Answered on July 17, 2019 at 06:51 AM

    As far as I know, you are not allowed to use a custom domain with API commands. If you have concerns or questions about the API, please contact our API team at api@jotform.com.

    Thank you! :)

  • Profile Image
    prosci8
    Answered on July 17, 2019 at 05:55 PM

    Okay, none of that is the point. It's not a completely custom domain, it's a subdomain on "jotform.com" (as I indicted - http://SUBDOMAIN.jotform.com), which works perfectly fine with the API on an enterprise account. The point is, I wanted to highlight that it is not returning the correct domain in the link in the URL key of the JSON. Instead of giving me arbitrary advice, just say that you don't know what I'm talking about.

    Thank you for the API email link. I've emailed them before and never received a response. I will try again, although at this rate it seems I shouldn't bother. I hope when I need actual help it goes better.

  • Profile Image
    prosci8
    Answered on July 18, 2019 at 06:15 PM

    Still no reply from api@jotform.com on either of my questions.

  • Profile Image
    roneet
    Answered on July 18, 2019 at 09:09 PM

    If I have understood correctly, you want the API response to contain URL like joform.us, jotform.com, eu.jotform.com, etc.

    15634983821.PNG

    If this is what you want then we can raise a feature request to our development team. Please confirm us.

    Thanks.

  • Profile Image
    prosci8
    Answered on July 22, 2019 at 07:24 PM

    Hi roneet,

    Nope, that's not what I mean, but thank you for taking the time to try and understand. We can close this issue now as the API team has responded to my email (I sent them the same information as on here) :


    Hey Nevar,
     
    We fixed the URL issue, 
     
    Thanks for reporting it.
     
    Kindest Regards.
     
    Ertuğrul E. Ertekin