Region
| Region | Region Id |
| Europe | r1 |
| North America | r2 |
| Asia Pacific | r3 |
Categories
- Access token
- Entity
- Contacts
- Segments
API for D365 Marketing
Access Token
- Token is used for security of application. If you want to access API of library then authentication is required. Token is passed in header part of API call.
Get Token API
| Method | URL |
| POST: To create a token | https://annex.crm.dynamics.com/common/oauth2/token |
| Header parameter | Content-type: application/x-www-form-urlencoded |
| Post data fields |
|
Note: Authorization Type is OAuth 2.0. Need to add an access token for each API execution.
Entity Details
How to Create an Entity into D365 Marketing
- Login to a Microsoft Powerapps account.
- Navigate to Data >> Tables.
- Click on the New Table Button on the left side of the Ribbon. Add Entity Name to the text box.
- Copy the name of the created Entity for future use.
The following image shows the tables home screen.
.png)
Click on Add Column to add columns to an entity as per the requirements. Add Display Name, Name, Data Type, Required field details.
.png)
How to Add/Get Records from an Entity using API
Get Records From Entity
Here, in this API we can pass field names for which we want to get the value & the Top limit records want to fetch from the Entity.
| Method | URL |
| GET: To get records from Entity | https://annex.crm.dynamics.com/api/data/v9.0/cr0dd_loyaltyactivities? $select=cr0dd_loyaltyid,firstname,lastname,emailaddress1&$top=1000 |
| Header Parameters |
|
Add Records into Entity
| Method | URL |
| POST: To add records into Entity | https://annex.crm.dynamics.com/api/data/v9.0/cr0dd_loyaltyactivities |
| Header Parameters |
|
Contacts
Add Contacts
| Method | URL |
| POST: To addcontact | https://annex.crm.dynamics.com/api/data/v9.0/contacts?$select=contactid,emailaddress1,createdon |
| Header Parameters |
|
Update Contacts
ContactId i.e. GUID is unique id of the Contact.
| Method | URL |
| PATCH: To update contact | https://annex.crm.dynamics.com/api/data/v9.0/contacts(contactId) |
| Header Parameters |
|
Get All Contacts
Need to add query & column names for which you want to fetch values for Users.
| Method | URL |
| GET: To get all records from Entity | https://annex.crm.dynamics.com/api/data/v9.0/contacts $select=cr0dd_loyaltyid,firstname,lastname,emailaddress1 |
| Header Parameters |
|
Get Specific Contact
Need to add a filter & value to get specific records against the filter.
| Method | URL |
| GET: To get Specific record from Entity | https://annex.crm.dynamics.com/api/data/v9.0/contacts?$filter=emailaddress1 'annextest123@annex.com' |
| Header Parameters |
|
Sync Contacts from MSD365 to AnnexCloud :
Here, we have Synced Contacts from MSD365 to AnnexCloud. So that, the changes occurred in MSD365 for any Contact will be synced into AnnexCloud end. We have consumed following MSD365 API for the same.
| Method | URL |
| GET: Get all contacts as per selection criteria | https://annex.crm.dynamics.com/api/data/v9.0/contacts?{{selection criteria}} |
| Header Parameters |
|
Segments into MSD365 Marketing
We are working with Dynamic Segments here.
Create Segment
| Method | URL |
| POST: Creates a segment within the MSD365 Marketing account | https://annex.crm.dynamics.com/api/data/v9.0/msdyncrm_segments |
| Header Parameters |
|
| Post Data | {{data array}} |
Update Segment
| Method | URL |
| PATCH: Update existing segment | https://annex.crm.dynamics.com/api/data/v9.0/msdyncrm_segments({{segment id}}) |
| Header Parameters |
|
| Post Data | {{data array}} |
Delete Segment
| Method | URL |
| DELETE: Delete existing segment | https://annex.crm.dynamics.com/api/data/v9.0/msdyncrm_segments({{segment id}}) |
| Header Parameters |
|
Get Segment List
| Method | URL |
| GET: Get lists of segments | https://annex.crm.dynamics.com/api/data/v9.0/msdyncrm_segments?{{selection criteria}} Note: selection criteria means passed fields required in response |
| Header Parameters |
|
Get Segment Details
| Method | URL |
| GET: Get lists of segments | https://annex.crm.dynamics.com/api/data/v9.0/msdyncrm_segments?{{selection criteria}} Note: selection criteria means passed filter field (eg. msdyncrm_segmentname eq ‘test’ ) |
| Header Parameters |
|
Get Members of the Segment
| Method | URL |
| POST: Get lists of segments | https://annex.crm.dynamics.com/api/data/v9.0/ msdyncrm_FetchContactsByQuery |
| Header Parameters |
|
| Post Data | {{selection query array}} |
Sync Segments From Annex Cloud to Microsoft D365 Marketing
In this use case, we have Consumed MSD API to get Segment List, get Segment Details, get Segment Members & push Segment & members data to Annex Loyalty API.
Sync Segments From Microsoft D365 Marketing to Annex Cloud
In this Use Case, we are fetching Segments & Segments Members from AnnexCloud & pushing the same to MSD 365 by consuming APIs like Add Segment, Update Segment etc.