What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How to Flag submission using C# API

    Asked by godish on August 12, 2013 at 01:14 PM

    Hello I was trying to update the flag status through C# API for single submission but it gave me the HTTP Request Error : 400 which means the request i am making is not valid.

    This is my code please Let me know if i am doing something wrong thanks

    Dictionary<stringstring> newSubmission = new Dictionary<stringstring>();                     newSubmission.Add("flag""1");                     var result = client.editSubmission(submissionId, newSubmission);                    // Conform Flag update                     var testPostSub = JObject.Parse(result.ToString());                     var test = (string)b.SelectToken("message");
    Can you please help me out on this thanks

    flag style message status
  • Profile Image
    JotForm Support

    Answered by Mike_T on August 12, 2013 at 03:27 PM

    Can you please try the following code on your side?

    var jotformAPIClient = new JotForm.APIClient("YOUR API CODE");
    Dictionary newSubmission = new Dictionary();
    newSubmission.Add("flag", "1");
    var result = jotformAPIClient.editSubmission("YOUR SUBMISSION ID", newSubmission);

    If this is not working, we can ask our developers to check it.

    I am not sure about the http request, but the following CURL example is working. It is updating the flag on a single submission:

    curl -X POST -d "submission[flag]=1" "http://api.jotform.com/submission/SUBMISSION_ID?apiKey=YOUR_API_KEY"

    If you need any further help on this, please let us know.

  • Profile Image

    Answered by godish on August 12, 2013 at 04:19 PM

    Hi thanks for the reply I tried the same thing as you had on the example for C# API in you web and it is giving me the same error but i have not tried the curl thing can you tell me how to use this curl thing and ask your developer to chech that edit method for the C# please 

    thanks

  • Profile Image
    JotForm Support

    Answered by jonathan on August 12, 2013 at 06:41 PM

    @ godish

    Hi, the cURL is a command line tool. You may need to install the library on your end to have a test use if you are on a Windows environment (which I think you are since your are also using C#)

    So in the sample code

    curl -X POST -d "submission[flag]=1" "http://api.jotform.com/submission/SUBMISSION_ID?apiKey=YOUR_API_KEY"

    you will need to have cURL installed to be able to test it using command line tool.

    If you are simply using the "Try it out" button in the API docs for cURL http://api.jotform.com/docs/#post-submission-id , can you clarify if this is where you are having issue?

    ---

    As for the C#, may I request also for a bit of help on your end for us to check this further. Will you be able to provide us more details on your implementation? Is there any website where we can see this applied?

    I do not have the C# on my end, so I am not able to do a test on it. If you can provide us the appropriate data using your form and keys, we can do some test also.

    Thanks.

  • Profile Image
    JotForm Support

    Answered by Mike_T on August 12, 2013 at 06:59 PM

    I have noticed that you were interested in http request sample per your previous thread, so I have made some more tests, and here it is.

    In order to flag the submission you can run a POST request with the following path:

    http://api.jotform.com/submission/submissionIdInQuestion?apiKey=yourApiKeyHere&submission[flag]=1

    The same with changed first name on question 15 (Full Name field in my case):

    http://api.jotform.com/submission/submissionIdInQuestion?apiKey=yourApiKeyHere&submission[flag]=1&submission[15][first]=John

    We will also try to check the C# example with our developers.

  • Profile Image
    JotForm Developer

    Answered by ceren on August 14, 2013 at 04:29 AM
    Hi godish,
    I've tested your code and it's working fine.
    Here is the code block:
    var client = new JotForm.APIClient("API KEY");
    Dictionary newSubmission = new Dictionary();
    newSubmission.Add("flag", "1");
    var result = client.editSubmission(SUBMISSION ID, newSubmission);
    var testPostSub = JObject.Parse(result.ToString());
    var test = testPostSub.SelectToken("message");
    Console.Out.WriteLine(test);
    Console.ReadLine();
    Can you check your API key and submission ID?
    Your API key should have Full-Access permission to post data. You can set your API key permissions on API section under MyAccount page.
    I've fixed editSubmission method on API docs page. You can try it out from there.
    If you need any further help on this, please let us know.