Jump to content

Featured Replies

Posted

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 ?

Solved by Hosfad

Go to solution
  • 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 by Hosfad

  • Author
  • Solution

Turns out adding a null param as the second param to the .post request does it 😮 

 

Edited by Hosfad

Recently Browsing 0

  • No registered users viewing this page.