Create content with an admin panel API route in other app

System Information
  • Strapi Version: 3.5.4
  • Operating System:
  • Database: Mongo
  • Node Version:
  • NPM Version:
  • Yarn Version:

Hi,

I’m trying to use an API route used by the Strapi admin Panel to create a content outside the Admin panel with an other application.

To do that I use the admin/login POST route to get the admin token. This works fine, but when I try to create a content with a POST (route used by the strapi admin panel) /content-manager/collection-types/application::delivery.delivery I have a 405 error.

Is the error linked to the fact I’m trying to use the API route outside the Admin Panel ?
And if not, do you think it will works and the content will well create and assign with the created_by of the user who created that ?

If not, what is the solution to do that ? I read thing about the created_at not very nice if I have to manage it by myself…

The api call

fetch("http://localhost:1337/collection-types/application::delivery.delivery", {
  "headers": {
    "accept": "application/json, text/plain, */*",
    "accept-language": "fr-FR,fr;q=0.9,en;q=0.8",
    "authorization": "Bearer blablabalabalfjidsfj",
    "content-type": "application/json;charset=UTF-8",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-site"
  },
  "referrer": "http://localhost:3333/",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": "{\"sellerLabel\":\"TEST\",\"price\":\"90\",\"description\":\"TEST\",\"expedition\":\"TEST\",\"carrier\":\"TEST\"}",
  "method": "POST",
  "mode": "cors",
  "credentials": "include"
});``` 

Thanks