Mail API
The Mail API can be used by end users and monitoring tools to submit requests by sending email to the email address of a service provider organization’s Xurrent account. The Mail API can also be used to add a note to an existing request, problem, task, etc. by including the ID of the record in the Subject field.
The Xurrent Email Addresses
Each Xurrent account has its own email address. In the production environment the email address of a Xurrent account is account_id@mail.4me.com
, in QA this becomes account_id@mail.Xurrent.qa
. You can find the id of your organization’s Xurrent account when you open the ‘Account Overview’ section in the Settings console.
The Mail API is available for each Xurrent demo instance. To tell the Mail API for which demo instance the inbound email is intended, the name of the demo instance needs to be included in the email address to which the email is sent. This is different from the QA and production environments of Xurrent where only the name of the Xurrent account needs to be included in the email address. If the name of your demo instance isInstance1
and the Xurrent account in which you want to generate a new request iswdc
, you can send the email towdc+Instance1@mail.4me-demo.com
.
In addition, each team that is registered in a Xurrent account can be given its own email address. An email address of a team looks like team-name.account_id@mail.4me.com
, where team-name
is the local part of the email address that is unique for the account. This local part can be defined by an administrator of the account.
The Xurrent Email Policy
It is important to verify that the Email Policy option ‘Allow inbound email to generate new requests’ is checked (see Settings console, option Email Policy). If it is not, an inbound email message will not cause a new request to be generated and the sender of an email will receive an email that is based on the email template ‘Email Rejected’.
Question
What settings do you need to update in order to send an email from your personal email address to the Widget Data Center account (wdc) in a demo instance?
There are a few possibilities:
- create a person record for the sender of the email in the wdc account and make sure that the option ‘Generate new requests’ in Account Settings – Email Policy is set to Always, or
- go to the Account Settings – Email Policy and enable ‘Register new person when email is received from unknown sender’, or
- go to the Account Settings – Email Policy and enable ‘Allow email parameter #from:’. Define your email address as the Sender and include #from:howard.tanner@widget.com and the authorization code with the tag #auth: at the start of the body of the email.
The Xurrent Email Parameters
When a request is created by an email you can set some request fields by specifying a parameter at the start of the email body. A parameter should start with a hashtag #
and between the parameters a new line must be set.
Add a blank line between the parameters and the rest of the email body.
Note that:
- parameters cannot be used to update the field values of an existing request;
- the user specified in the
From
email address needs to have a person record that has the specialist role in the Xurrent acount; - the
requested_for
parameter is processed only if the sender’s Person record has the Service Desk Analyst role.
For example with the following parameters in the email body the Requested for user, a Configuration Item, the Team and the Team Member are set to the new request :
#sourceID: 98899-9
#requested_for: jane.young@example.com
#ci: P31
#team: SAP Basis Support
#member: john.smith@example.com
email body …
Exercises
Can you create an RFI in the ‘wdc’ account for chris.ball@widget.com on the ‘Houston Office Network’ SI?
#sourceID: email1
#rfi
#requested_for: chris.ball@widget.com
#service_instance: Houston Office Network
First time here
Can you create an RFC in the ‘wdc’ account for beatrice.baldwin@widget.com based on the ‘Move Widget Data Center desktop PC’ request template when her PC’s label is CMP00023?
First use the Request Templates API to find the id of the ‘Move Widget Data Center desktop PC’ template:
curl -X GET -i -H "Authorization: Bearer <personal-token>" -H "X-Xurrent-Account: wdc" "https://api.4me-demo.com/v1/request_templates?subject=Move%20Widget%20Data%20Center%20desktop%20PC&fields=id"
Then use the template ID to create the request:
#sourceID: email2
#requested_for: beatrice.baldwin@widget.com
#ci: CMP00023
#template_id: 23
Can you create a ‘down’ event in the ‘wdc’ account for the ‘Expense Reporting Production Database’ CI?
First use the Configuration Items API to find the label of the ‘Expense Reporting Production Database’ CI in the ‘wdc’ account:
curl -X GET -i -H "Authorization: Bearer <personal-token>" -H "X-Xurrent-Account: wdc" "https://api.4me-demo.com/v1/cis?name=Expense%20Reporting%20Production%20Database&fields=label&updated_at=>2010-01-05T23:00:00Z"
Then use the label of the configuration item to create the event:
#sourceID: email3
#ci: DBS00025