How to Flag submission using C# API

  • Profile Image
    Asked 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

  • Profile Image
    Answered 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" ""

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

  • Profile Image
    Answered 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 


  • Profile Image
    Answered 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" ""

    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 , 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.


  • Profile Image
    Answered 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:[flag]=1

    The same with changed first name on question 15 (Full Name field in my case):[flag]=1&submission[15][first]=John

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

  • Profile Image
    Answered 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");
    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.