Invision Community 5: A video walkthrough creating a custom theme and homepage By Matt Thursday at 04:02 PM
Interferon Posted October 4 Posted October 4 (edited) I am trying to use the REST API to automatically upload a file to the Invision downloads system: if (!InvisionPower::Initialize(communityurl, clientid)) { Notify("CURL failed to initialze.", "Error", true); } std::string token = InvisionPower::AuthenticateUser(name, password, "/downloads/files"); std::string options; options += "category=97&description=MyDescription&title=FileName&author=1&"; options += "files=file=file.zip&contents=MDAwMDAw"; auto j3 = InvisionPower::APICall("/downloads/files/", token, options); if (j3["response"].is_object()) { std::string response = j3["response"]; } I have enabled the needed endpoint in our admin panel: I keep getting an error that says NO_PERMISSION when I run the code. Any idea what's wrong? Edited October 4 by Interferon
Solution Interferon Posted October 4 Author Solution Posted October 4 I figured it out, I was confusing the scope and the end point in the user authentication.
Recommended Posts