API: update the Emails propertis by API call

  • Profile Image
    geo.awad
    Asked on October 01, 2021 at 09:46 AM

    Hello,

    I have been struggling with this issue for the past few weeks please. I sent 2 emails to the api email BUT NO ONE IS ANSWERING BACK......!!!!

    I have a form, I need using API to update the "to" field in the notification email ONLY...everything else stays the same (the from, the body, etc)...when I use the PUT or POST methods, they simply replace the whole notification object and thus deleting my body and "from" information which is I need to stay the same.....It looks that PATCH is the correct way to go but also it seems it's not allowed to be used?...please confirm this and please see if it can be added. I need someone to get back to me with some useful information please that I can apply

    Thanks and waiting to hear back

    George


  • Profile Image
    Richie_P
    Answered on October 01, 2021 at 11:36 AM

    Please share the method or language you used to call the API.

    You can also share the command or code snippet for us to check.

    Looking forward for your response.


  • Profile Image
    geo.awad
    Answered on October 01, 2021 at 12:10 PM

    I was initially using pipedream tool workflow.

    Anyways, when it got stuck I decided to test this using the terminal curl command:

    curl -X PATCH -d '{"properties":{"emails":[{"type":"notification", "to":"geo.awad@gmail.com"}]}}' "https://hipaa-api.jotform.com/form/212734184357054/properties?apiKey=XXXX"

    NOTE: I removed my apikey here and substituted it with XXXX.

    Trying to use PUT or POST also needed to add more fields (body, etc)..but the point is I ONLY want to update the "to" address...and keep everything else without modification.

    Please help! Thanks!

  • Profile Image
    Ahmed_S
    Answered on October 01, 2021 at 06:22 PM

    Hello George,

    Please try to use the below format if you want to alter the "to" property of the email parameter, if you want to add several addresses as recipients then you may separate between each with a comma.

    "emails[i][to]=geo.awad@gmail.com"

    please replace the i with the index number of your listed form emails (notifications/ autoresponder), they are indexed starting from 0 as they are already listed in your form settings, so the first notification/autoresponder email will be email[0], the second one will be email[1] and so on, please check this API reference for more details.

    https://api.jotform.com/docs/#post-forms

    Please give it a try and let us know how it goes, you can also email any further API issues to our API team through this email api@jotform.com


  • Profile Image
    George 
    Answered on October 01, 2021 at 06:47 PM

    Hello Ahmed,

    I tried this but gave me the following error message:

    {"responseCode":400,"message":"Missing parameters: properties","content":"","duration":"15.59ms","info":"https:\/\/api.jotform.com\/docs#form-id-properties"}


    In the request I send I only use emails[0][to] (I don't use the properties at all).

    Can you give me an example please of how would you format the command?

    Thanks


  • Profile Image
    Ahmed_S
    Answered on October 02, 2021 at 01:25 AM

    Hello George,

    I apologize for this inconvenience, the format in my previous reply is applicable only when creating a new form, after reviewing the API documentation, unfortunately it's not possible to edit the notification/autoresponder email recipient's address of a form with an API call.

    I'll raise this issue to our developers team to consider the possibility to update our API with this option, although we can't provide an estimated time for when this feature would be implemented but you will be notified once we have an update through this ticket.

    Thank you for your understanding and please let us know if you need further assistance, we are happy to help.

  • Profile Image
    geo.awad
    Answered on November 19, 2021 at 10:30 PM

    Hi Ahmed,

    Do you know if this was done as API update or not yet? Can you please provide any news?

    Thanks, George


  • Profile Image
    Samuel_Ray
    Answered on November 20, 2021 at 04:11 AM

    Hi there,

    We still have not received any updates about this feature update. Please note that we cannot guarantee any ETA for the implementation nor if this will ever be implemented.

    As soon as we have news about its implementation, we'll send you an update via this thread.

    Please don't hesitate to reach back out to us if you need further help with anything. Thank you!