• Resolved webberz2017

    (@webberz2017)


    I have the Pro version of Total Contest. The REST API has no documentation and I am not getting a response from your support.

    Please provide details / instructions how to format the POST API submission for an image and for the logged in user data. Please provide postman.com screenshots with these working

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter webberz2017

    (@webberz2017)

    the image is not being saved in the WP admin

    Plugin Author TotalSuite

    (@totalsuite)

    Hello,

    Thank you for your patience!

    Here is a screenshot of the request: https://ibb.co/VJzn33z

    The payload (body) should be of type “multipart”,

    
    const form = new FormData();
    form.append("totalcontest[image]", "/path/to/image.png");
    
    fetch("https://DOMAIN/wp-json/totalcontest/v2/contest/CONTEST_ID/participate", {
      "method": "POST",
      "headers": {
        "Content-Type": "multipart/form-data; boundary=---011000010111000001101001",
      }
    })
    .then(response => {
      console.log(response);
    })
    .catch(err => {
      console.error(err);
    });

    Please note that you need to send the request to “https://DOMAIN/wp-json/totalcontest/v2/contest/CONTEST_ID/participate”, there is a typo (“/enter” instead of “/participate” in the UI that we will fix in the next update.

    I hope it helps, if you need further assistance please feel free to reach out to our support.

    Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘REST API image and user data’ is closed to new replies.