有一个应用程序可以直接执行此操作,但它是一个付费的非官方解决方案。 您将需要来自provider的令牌。 在这里阅读有关该方法的更多信息:https://whapi.readme.io/reference/createstory
const options = {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/json',
authorization: 'Bearer Your_Token'
},
body: JSON.stringify({
background_color: '#00000000',
caption_color: '#FFFFFFFF',
caption: 'Hello world',
font_type: 'OSWALD_HEAVY',
// media: 'data:image/png;name=test.png;base64,iVBORw0KG...........',
contacts: ['any number', 'any number']
})
};
fetch('https://gate.whapi.cloud/stories', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));