mailThreads API Not Working as Expected


#1

I think the put /mailbox/mailThreads/{id} endpoint has a bug.

I wrote a script that has been in use for about 6 months. It looks up deals and attaches a given mail thread to the appropriate deal. The script has worked as expected until recently. The endpoint is still returning 200, but the emails are not actually getting attached to deals. I’ve even tried using the endpoint tester in the API reference. It also returns 200 but doesn’t actually update the deal_id of the mailThread.

I’ve checked the API documentation and do not see any changes to the API that would cause this issue. Please help :slight_smile:

I just tested again in the API endpoint tester.

// JSON in the request object
{
“deal_id”: “446”,
“archived_flag”: “0”
}

// Response JSON
{
“data”: {
“id”: 79247,
“folders”: [
“inbox”
],
“account_id”: “4pdfg0r5p903sc45u63k2llk8”,
“user_id”: 1547158,
“version”: 79,
“subject”: “foo bar”,
“snippet”: “foo bar”,
“snippet_draft”: null,
“snippet_sent”: “”,
“message_count”: 18,
“read_flag”: 1,
“mail_tracking_status”: null,
“has_attachments_flag”: 1,
“has_inline_attachments_flag”: 0,
“has_real_attachments_flag”: 1,
“has_draft_flag”: 0,
“has_sent_flag”: 0,
“archived_flag”: 0,
“deleted_flag”: 0,
“shared_flag”: 0,
“synced_flag”: 1,
“external_deleted_flag”: 0,
“smart_bcc_flag”: 0,
“first_message_to_me_flag”: 0,
“mail_link_tracking_enabled_flag”: 0,
“last_message_timestamp”: “2017-11-22T02:30:56.000Z”,
“first_message_timestamp”: “2017-11-15T05:59:46.000Z”,
“last_message_sent_timestamp”: null,
“last_message_received_timestamp”: “2017-11-22T02:30:56.000Z”,
“add_time”: “2017-11-15T06:00:05.000Z”,
“update_time”: “2017-11-22T02:42:43.000Z”,
“deal_id”: null,
“deal_status”: null,
“write_flag”: false
},
“success”: true,
“statusCode”: 2000,
“statusText”: “Success”,
“service”: “email-api”
}


#2

Hey @ian.sikora thanks for letting us know, we are investigating this right now and I will get back to you shortly.


#3

It seems the problem is within our API test page, if you run the query in Postman it will update deal_id fine. Could you try again with your script or with Postman to see if it works for you please?


#4

Hey, actually the problem is that right now this endpoint is not properly handling multi form data, while this is being fixed it works fine with JSON.


#5

@diego.mendez, thanks for the update. I changed my script to use JSON instead of form-data and it’s working as expected.


#6

@diego.mendez am not getting errors that mailThreads is not implemented. Are you guys deprecating this endpoint?

// when testing on the api docs

RESPONSE CODE
501

HEADERS
{
    "x-ratelimit-remaining": "198",
    "x-ratelimit-reset": "7",
    "content-type": "application/json",
    "x-ratelimit-limit": "200"
}

BODY
{
    "success": false,
    "error": "This method is not implemented.",
    "error_info": "Please check developers.pipedrive.com for more information about Pipedrive API.",
    "data": null,
    "additional_data": null
}

#7

Hey @ian.sikora this will be fixed in our api reference page soon, issue is that url is only supported with company domains now, so will work fine with yours.