Jump to content

API Post Requests


Ryan Carr

Recommended Posts

I am not sure how to send the API key and data to the post API request. I have tried making a forum and sending it to the API method that calls for a post request.

<form action="/api/forums/topics" method="post">
    <input type="hidden" name="key" value="XXXXXXXXXXX">
    <input type="text" name="forum"><br />
    <input type="text" name="author"><br />
    <input type="text" name="title"><br />
    <input type="text" name="post"><br />
    <input type="submit" name="submit" value="Submit">
</form>

 

Link to comment
Share on other sites

On 11/7/2016 at 6:47 PM, Ryan Carr said:

I am not sure how to send the API key and data to the post API request. I have tried making a forum and sending it to the API method that calls for a post request.


<form action="/api/forums/topics" method="post">
    <input type="hidden" name="key" value="XXXXXXXXXXX">
    <input type="text" name="forum"><br />
    <input type="text" name="author"><br />
    <input type="text" name="title"><br />
    <input type="text" name="post"><br />
    <input type="submit" name="submit" value="Submit">
</form>

 

Point the form at a local controller(php file) that uses the API to actually create the post, and remove the 'key' as an input. Never, ever, evereverever reveal your API key in visible code like that, it opens it up to abuse. One page inspection with debug tools is all one requires to obtain the API key with the form like that.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...