-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bulk user creation has wrong Accept header #91
Comments
Update: I tried to switch away from your client and use the widely spread return request.post( {
uri : 'https://api.intercom.io/bulk/users',
'auth': {
'user' : process.env.INTERCOM_APP_ID,
'pass' : process.env.INTERCOM_APP_ID_KEY,
'sendImmediately' : false
},
headers : {
'Accept' : 'application/json',
'Content-Type' : 'application/json'
},
body : { items : members },
json : true,
transform : function( body, response, resolveWithFullResponse ) {
console.info( '[intercom] [INFO] [Setup: transform]',
JSON.stringify( body )
);
return body;
}
} )
.then( function( response ) {
console.info( '[intercom] [INFO] [Setup: response]', response );
} ) The [intercom] [INFO] [Setup: transform]
{
"app_id": "xxxxx",
"id": "job_xxx",
"created_at": 1464183095,
"completed_at": null,
"closing_at": 1464183995,
"updated_at": 1464183095,
"name": "api_bulk_job",
"state": "running",
"links": {
"error": "https://api.intercom.io/jobs/job_xxx/error",
"self": "https://api.intercom.io/jobs/job_xxx"
}
} The actual response is the following: [intercom] [INFO] [Setup: response]
{
app_id : 'xxxxx',
id : 'job_xxx',
created_at : 1464183095,
completed_at : null,
closing_at : 1464183995,
updated_at : 1464183095,
name : 'api_bulk_job',
state : 'running',
links : {
error : 'https://api.intercom.io/jobs/job_xxx/error',
self : 'https://api.intercom.io/jobs/job_xxx'
}
} Where the |
@franz-josef-kaiser This appears to be that you're receiving the correct job model response, but when you try to access the error URL, you are not passing the 'Accept' header, so it is returning that response. Try accessing the error URL and passing the correct 'Accept' header with it. Does that help? |
@edkellena As you can see from above plain request using the npm |
Ok, this has been a big time misunderstanding: The fact that |
I believe I am having the same issue, using the node intercom client |
@coopernewby Have you read my last comment? Job queue and such? P.s.: Can you please use code formatting? Makes it much easier to read. |
Yes sorry about the formatting. I just don't understand how long the bulk jobs seem to run for or how to fix the 'media_type_not_acceptable' error. This is what I am passing in: |
Are you looking at the request in a browser? Use something like the Postman app instead. |
Yes! Got it. I ran this and got much more information on the job about errors or if the bulg job was done |
Version info
Expected behavior
Create users in bulk
Actual behavior
Returns an error list containing an error of type:
media_type_not_acceptable
Steps to reproduce
error.list
Client:
Request:
Logs
Result of the error list:
The text was updated successfully, but these errors were encountered: