I have…
- [x] Read the following guideline: https://docs.squidex.io/01-getting-started/installation/troubleshooting-and-support. I understand that my support request might get deleted if I do not follow the guideline.
I’m submitting a…
- [ ] Regression (a behavior that stopped working in a new release)
- [ ] Bug report
- [ ] Performance issue
- [x] Documentation issue or request
Current behavior
Hello!
So I try to do upsert content of my app using content API. But I only get ‘Request failed with status code 400’ error.
Can you point me at what am I doing wrong or prompt where can I find examples of valid queries for upserting content using Content API?
Expected behavior
The upsert request upserts content.
Minimal reproduction of the problem
I try to make a post request using this piece of code:
const config = {
headers: {
Authorization: getters.AUTHORIZATION_TOKEN,
'Content-Type': 'application/json',
Accept: 'application/json'
}
}
// mediaPage variable consists of all the needed content data.
const mediaPage = {
title: {
iv: 'Abc'
},
lead: {
iv: '-'
},
views: {
iv: 2
},
article: {
iv: '-'
},
previewCover: {
iv: [
[Object]
]
},
author: {
iv: {
name: '-',
role: '-',
photo: [Array]
}
},
description: {
iv: '- '
},
pinned: {
iv: true
},
publishedAt: {
iv: '2021-08-20T10:38:36Z'
},
tags: {
iv: [
'-',
'+'
]
},
readingTime: {
iv: '5 mins'
},
cover: {
iv: [
[Object]
]
}
}
const content = await this.$axios.$post(`/api/content/man-platform/media-page/${id}?publish=true`,
mediaPage,
config)
Environment
- [ ] Self hosted with docker
- [ ] Self hosted with IIS
- [ ] Self hosted with other version
- [x] Cloud version
Browser:
- [x] Chrome (desktop)
- [ ] Chrome (Android)
- [ ] Chrome (iOS)
- [ ] Firefox
- [ ] Safari (desktop)
- [ ] Safari (iOS)
- [ ] IE
- [ ] Edge