Я новичок в Apple News Platform. Я начал использовать Apple News API для создания статей для Apple News, используя REST. Для этого я создал канал на Apple News Publisher, и я могу создавать статьи оттуда. Поэтому для использования Apple News API я создал ключ API, идентификатор канала и секрет из настроек. Затем я следовал тому же примеру, приведенному в документации, используя post man. но, несмотря на всю правильную информацию, вызов POST возвратил «код»: «WRONG_SIGNATURE», я не могу найти фактическую причину этого
Заголовки для пост-запроса:
Authorization : HHMAC; key="xxxxxxxx-d9bf-xxxx-9fb6-64c8bb4b1496"; signature="lCOOG8yrEYny/PDaDlQ43eGtiByW5jsndfks+ff35xns="; date="2019-10-10T12:54:19Z"
Content-Type : multipart/form-data; boundary=535e329ca936f79a19ac9a251f7d48f7
Accept : application/json
Content-Type : application/json
Content-Disposition : form-data; filename=article.json; name=article.json
and body has :
POST : /channels/xxxxxxxx-xxxx-xxxx-8d41-67919f759014/articles HTTP/1.1
Host : news-api.apple.com
--535e329ca936f79a19ac9a251f7d48f7
{
"version": "1.0",
"identifier": "Apple_Demo",
"title": "Sample article for test",
"language": "en",
"layout": {
"columns": 7,
"width": 1024,
"margin": 70,
"gutter": 40
},
"subtitle": "this is the demo sample text by api!!",
"metadata": {
"excerpt": "Simple with Headline above Header Image",
"thumbnailURL": "https://developer.apple.com/news-publisher/download/Apple-News-Example-Articles/images/Iceland01.jpg"
},
"documentStyle": {
"backgroundColor": "#f6f6f6"
},
"components": [
{
"role": "title",
"layout": "titleLayout",
"text": "Headline Above Image",
"textStyle": "titleStyle"
},
{
"role": "intro",
"layout": "introLayout",
"text": "this is the sample text for demo",
"textStyle": "introStyle"
},
{
"role": "header",
"layout": "headerImageLayout",
"style": {
"fill": {
"type": "image",
"URL": "https://developer.apple.com/news-publisher/download/Apple-News-Example-Articles/images/Iceland01.jpg",
"fillMode": "cover",
"verticalAlignment": "center"
}
}
},
{
"role": "author",
"layout": "authorLayout",
"text": "Byline | Publisher | Date",
"textStyle": "authorStyle"
},
{
"role": "body",
"text": "this is another sample text for demo \n\n",
"layout": "bodyLayout",
"textStyle": "bodyStyle"
}
],
"componentTextStyles": {
"default-title": {
"fontName": "HelveticaNeue-Thin",
"fontSize": 36,
"textColor": "#2F2F2F",
"textAlignment": "center",
"lineHeight": 44
},
"default-subtitle": {
"fontName": "HelveticaNeue-Thin",
"fontSize": 20,
"textColor": "#2F2F2F",
"textAlignment": "center",
"lineHeight": 24
},
"titleStyle": {
"textAlignment": "left",
"fontName": "HelveticaNeue-Bold",
"fontSize": 64,
"lineHeight": 74,
"textColor": "#000"
},
"introStyle": {
"textAlignment": "left",
"fontName": "HelveticaNeue-Medium",
"fontSize": 24,
"textColor": "#000"
},
"authorStyle": {
"textAlignment": "left",
"fontName": "HelveticaNeue-Bold",
"fontSize": 16,
"textColor": "#000"
},
"bodyStyle": {
"textAlignment": "left",
"fontName": "Georgia",
"fontSize": 18,
"lineHeight": 26,
"textColor": "#000"
}
},
"componentLayouts": {
"headerImageLayout": {
"columnStart": 0,
"columnSpan": 7,
"ignoreDocumentMargin": true,
"minimumHeight": "40vh",
"margin": {
"top": 15,
"bottom": 15
}
},
"titleLayout": {
"columnStart": 0,
"columnSpan": 7,
"margin": {
"top": 50,
"bottom": 10
}
},
"introLayout": {
"columnStart": 0,
"columnSpan": 7,
"margin": {
"top": 15,
"bottom": 15
}
},
"authorLayout": {
"columnStart": 0,
"columnSpan": 7,
"margin": {
"top": 15,
"bottom": 15
}
},
"bodyLayout": {
"columnStart": 0,
"columnSpan": 5,
"margin": {
"top": 15,
"bottom": 15
}
}
}
}
после запроса POST он показывает:
{
"errors": [
{
"code": "DATE_NOT_RECENT"
}
]
}
любая помощь будет высоко оценена !!