Netsuite REST API for email communications - netsuite

I am trying to find where in the NetSuite REST API the communication messages are stored. I have looked at messages but the list returns 0 even though there are a lot of emails that have been sent. Guessing I'm looking in the wrong place but not sure what path the records are in.
Also once I get the emails, is there a way to extract the attachments sent in the emails to download using the API?
Thanks!

You can execute a SuiteQL query.
POST https://[account].suitetalk.api.netsuite.com/services/rest/query/v1/suiteql
Header: Prefer: transient
Body:
{
"q": "SELECT id, authoremail, subject, datetime FROM message"
}
However, adding the attachments field to the search results to an unexpected error.
The record and field IDS are in the Analytics browser: https://[account].app.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2020_1/analytics/record/message.html.

Related

What is the proper architecture for requesting a document vs. document details in a REST API?

I'm designing a REST API using NodeJS and Express for managing different types of documents (txt, pdf, doc, etc). The document model is something like:
{
id,
category,
name,
path,
tags,
etc..
}
I currently have a route to GET a single document.
/documents/:id
This route serves up the actual document. I would love some guidance on the proper way to serve up the document details (i.e. the name, category, etc). Should I use a different URL? Send details in headers? Use response.format? Make the client specify via query?
Edit: I should clarify that the documents will be stored on the server filesystem and will not be directly accessible by any client.
If the document details are coming from a different source, the most straightforward way is to set up a different endpoint, /document-details/:id.
Otherwise, if a document can be stringified into a JSON, you could nest both in the same response:
{
document: {},
details: {
category,
name,
path,
tags
}
}
I would recommend against sending any detail about document in the HTTP header, those are usually used to send the details about the response itself.

I want to send email attachment using nodemailer in node js.i am using elasticemail gate way

I need to send a URL attachment in nodemailer.i try to many ways but mail was not deliverd.I was seen elasticemail gateway they showed a error like this "suppressed" how will i solve this issue
attachments:[{ // use URL as an attachment
filename:'GSTR3B_33ADQFS8223E1ZY_012019_1551501263.pdf',
path:'my url'}]
if you are getting "suppressed" from Elastic Email check in the Contacts section on your dashboard to be sure that the contact is in an "Active" state. The contact might be suppressed by the system.

Outlook REST API is returning 404 for event in message

I have the following case:
I use the Outlook REST API (without any library) to visualize the users' emails - including Event invites. First, I make a call to get only the message properties and if the message has MeetingMessageType value, then another request is sent to:
https://outlook.office.com/api/v2.0/me/messages/<messageId>?$select=Microsoft.OutlookServices.EventMessage/MeetingMessageType&$expand=Microsoft.OutlookServices.EventMessage/event($select=Id,SeriesMasterId,iCalUID,Type,CreatedDateTime,LastModifiedDateTime,WebLink,Calendar,Start,End,IsAllDay,IsCancelled,Organizer,Attendees,Location,Subject,ResponseStatus,OnlineMeetingUrl,Recurrence,ResponseRequested)
to get the Event information and provide the customer with the option to respond to the invite.
The problem:
Since yesterday one of our clients reported that he can't see the event information. It turns out that the request for getting this information is returning 404.
The response body:
{
"error": {
"code": "ErrorItemNotFound",
"message": "The specified object was not found in the store., The process failed to get the correct properties."
}
}
The event is shown in the Outlook desktop mail client.
The client also shared that they have enabled ATP (advance threat protection) at his company. Not sure if this can have anything to do with the problem.
I see that other clients also have this problem.
Update:
I asked the user to try the following requests from the Outlook sandbox:
https://outlook.office.com/api/v2.0/me/messages/<messageId>
This request returns the EventMessage with "MeetingMessageType": "MeetingRequest".
Then when he tried accessing the Event:
https://outlook.office.com/api/v2.0/me/messages/<messageId>?$select=Microsoft.OutlookServices.EventMessage%2FMeetingMessageType&$expand=Microsoft.OutlookServices.EventMessage%2Fevent
The Outlook REST API returns 404.
For me, the same formatted requests work, so I can't really understand what is going on.
Please, any information will be well appreciated!

DocuSign REST API bulk recipient transactions not showing in response

I have issues with getting the ID for the newly created envelopes when using the bulk send feature.
I'm using a template that has a bulk recipient signer (from a CSV file).
I've managed to create with success a draft envelope with a bulk recipient signer based on the template, to pass the CSV file to the envelope and to change the status to 'sent' in order to trigger the sending of an envelope for each recipient.
The issue is that the response returned from sending the envelope doesn't contains the 'bulkRecipientTransactions' element (the CSV file contains 2 signers).
Below you can see a response sample:
<envelopeUpdateSummary xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<bulkEnvelopeStatus>
<batchId>97ef8125-b305-4de7-837b-d89c36bd994e</batchId>
<batchSize>2</batchSize>
<bulkEnvelopesBatchUri>/bulk_envelopes/97ef8125-b305-4de7-837b-d89c36bd994e</bulkEnvelopesBatchUri>
<failed>0</failed>
<queued>2</queued>
<sent>0</sent>
<submittedDate>2015-07-24T07:10:18.9900000Z</submittedDate>
</bulkEnvelopeStatus>
</envelopeUpdateSummary>
The same result came back when i've used the DocuSign API explorer for creating & sending a bulk recipient envelope - no 'bulkRecipientTransactions' element.
Also I've tried to check the status of one bulk send batch (/accounts/{accountId}/bulk_envelopes/{batchId}), but I've got as a result only the general batch info's - the element 'bulkEnvelopes' was missing!
<bulkEnvelopeStatus xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<batchId>97ef8125-b305-4de7-837b-d89c36bd994e</batchId>
<batchSize>2</batchSize>
<bulkEnvelopesBatchUri>/bulk_envelopes/97ef8125-b305-4de7-837b-d89c36bd994e</bulkEnvelopesBatchUri>
<endPosition>2</endPosition>
<failed>0</failed>
<nextUri/>
<previousUri/>
<queued>0</queued>
<resultSetSize>0</resultSetSize>
<sent>2</sent>
<startPosition>0</startPosition>
<submittedDate>2015-07-24T07:10:18.9900000Z</submittedDate>
<totalSetSize>2</totalSetSize>
</bulkEnvelopeStatus>
For all the workflow I've used the REST API v2 using C# and xml.
When you use /accounts/{accountId}/bulk_envelopes/{batchId} to get envelopes, you need specify queryString ?include=(all,failed,queued,sent).otherwise, you may not get any envelopes list result

How to get body of mail by message-ID or any header

I'm creating an email app. To save time, I just download subject and some header and saved them to database, not download body of mail.
And then, If user click on subject, I will download body of this mail.
I try to use Message-ID (because it's unique) to make it is an index. and Using this code to find this mail on server
SearchTerm term = new MessageIDTerm(ID);
message_s = folder.search(term);
But it just success on GMAIL, some other server, this code doesn't work correct.
I try to get All message-ID and compare it on client side, It toke a lot of time to find, user can't wait too long to get body of email.
Anyone has an idea to find and download body of email correctly by Message-ID or by any header ?

Resources