请求的验证与请求的要求之间似乎存在冲突。API 调用要求将范围设置为“app”。它还需要一个用户 ID。但是,当两者结合时,您会收到以下消息,表明您无法将两者结合起来。
API https://docs.smooch.io/rest/#pre-create-app-user
要求
{ host: 'api.smooch.io',
path: '/v1/appusers',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
}
示例身体。
{
scope: 'app',
userId: 'some_userId',
credentialRequired: true,
email: 'test@email.com',
properties: { picture: 'https://s.gravatar.com/avatar/.....' }
}
响应体
{"error":{"code":"bad_request","description":"Invalid JWT body. Cannot use userId param with app scope"}}
响应头
{ connection: 'close',
server: 'nginx',
date: 'Tue, 21 Feb 2017 14:47:50 GMT',
'content-type': 'application/json; charset=utf-8',
'content-length': '105',
'x-powered-by': 'Express',
vary: 'X-HTTP-Method-Override',
etag: 'W/"69-huba/v8EazhrDAoySthrKw"',
via: '1.1 vegur' },
statusCode: 400,
statusMessage: 'Bad Request' }