Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted July 13, 20222 yr Hello im trying to make an auto message pumping system and i need to make a post request to the api to add the topic , currently im trying : axios.post("https://www.DOMAIN.com/api/index.php/forums/topics",{ params: { key: 'MYAPIKEY', forum: '79', title: 'pumping test', post: 'pumping test', author: '1', }}).then((res)=>{}).catch((err) =>{ console.log(err) }) And im getting a NO_API_KEY response : data: { errorCode: '2S290/6', errorMessage: 'NO_API_KEY' } Anyone has an idea how i should be adding the params ?
July 13, 20222 yr Try using basic auth instead as noted here: https://invisioncommunity.com/developers/rest-api You can only pass a key as a parameter in certain circumstances where the server doesn't support basic authentication.
July 13, 20222 yr Author 49 minutes ago, Stuart Silvester said: Try using basic auth instead as noted here: https://invisioncommunity.com/developers/rest-api You can only pass a key as a parameter in certain circumstances where the server doesn't support basic authentication. Hello , im having no trouble making the same request with insomnia using the api key as the authentication , its only when i try to make the post request with axios , i have also no trouble making get requests with axios This is also on my private api , so i dont need to worry about exposing the api key's Edited July 13, 20222 yr by Hosfad
July 13, 20222 yr Author Solution Turns out adding a null param as the second param to the .post request does it 😮 Edited July 13, 20222 yr by Hosfad