External API Workflow

Overview of how to utilize the external API

Step 1: Click on the link to create a Proposal

The user will click on a link within the API Partners platform, which will direct them to Ui.Marketing Proposal tool. The API partner will pass along their unique Id within the URL. Once a user completes a Proposal, we will save that unique Id to that Proposal. 

 


Step 2: Make a GET to the API endpoint /proposals

The API partner would then make a GET to the API endpoint /proposals by authorizationId, and pull in all Proposals created by that authorizationId. The API partner would be able to match the external_id to an Id in their software system. 

GET https://api.adcellerant.com/proposals

{
   "pageNumber": 1,
   "pageSize": 25,
   "totalPages": 1,
   "totalCount": 1,
   "results": [
       {
           "id": 2040,
           "createdDate": "2020-11-28T11:20:12.097Z",
           "updatedDate": "2020-12-01T05:30:45.123Z",
           "externalId": "47h8347W3",
           "name": "Example Proposal Foo",
           "advertiserId": "300",
           "hierarchyId": "200",
           "startDate": "2021-01-02T14:00:00.000Z",
           "endDate": "2021-03-09T14:00:00.000Z",
           "requester": "Some Requester",
           "budget": 23000,
           "orderId": "2398",
           "products": [{
               "productKey": "key",
               "budget": 10000,
               "startDate": "2021-01-02T14:00:00.000Z",
               "endDate": "2021-02-09T14:00:00.000Z"
           }]
       }
   ]
}

 

Step 3: Ability for users to click a link to Edit a proposal (If Applicable) 

Once the proposal is created, the API partner can edit a proposal by concatenating the URL with the external API's Proposal data. This is only if the user wants a dynamic edit link within the API partners system. 

 


Step 4: Ability for users to click a link to Campaign Hub (If Applicable) 

Once the user is ready to turn a proposal into an order, they can navigate to Ui.Marketing Campaign hub or click a link within the Partners API system to navigate to Campaign Hub to execute the order.

 


Step 5: Make a GET to the API endpoint /proposals to see if any Proposals now have an orderId

The API partner would then make a GET to the API endpoint /proposals by authorizationId, to see if any Proposals have been updated and update their opportunities with an orderId.

GET https://api.adcellerant.com/proposals

{
   "pageNumber": 1,
   "pageSize": 25,
   "totalPages": 1,
   "totalCount": 1,
   "results": [
       {
           "id": 2040,
           "createdDate": "2020-11-28T11:20:12.097Z",
           "updatedDate": "2020-12-01T05:30:45.123Z",
           "externalId": "47h8347W3",
           "name": "Example Proposal Foo",
           "advertiserId": "300",
           "hierarchyId": "200",
           "startDate": "2021-01-02T14:00:00.000Z",
           "endDate": "2021-03-09T14:00:00.000Z",
           "requester": "Some Requester",
           "budget": 23000,
           "orderId": "2398",
           "products": [{
               "productKey": "key",
               "budget": 10000,
               "startDate": "2021-01-02T14:00:00.000Z",
               "endDate": "2021-02-09T14:00:00.000Z"
           }]
       }
   ]
}

 


Step 6: Make a GET to the API endpoint /order to pull in any orders that have been created

The API partner would then make a GET to the API endpoint /order by authorizationId, to see if any orders have been created and match up the id up to an orderId that was pulled in from the proposal endpoint. 

GET https://api.adcellerant.com/orders

{
   "pageNumber": 1,
   "pageSize": 25,
   "totalPages": 1,
   "totalCount": 2,
   "results": [
       {
           "id": 2,
           "status": "PENDING",
           "advertiserId": "123",
           "hierarchyId": "200",
           "ownerEmail": "someEmail@domain.com",
           "name": "Sample Order - 1",
           "orderDetails": [
               {
                   "id": 14,
                   "status": "ACCEPTED",
                   "name": "Sample Order - 1, Detail - 2",
                   "budget": 1234.0,
                   "approvedBy": "someApprover@domain.com",
                   "startDate": "2020-05-01T04:30:45.123Z",
                   "endDate": "2020-05-30T04:30:45.123Z"
               },
               {
                   "id": 13,
                   "status": "PENDING",
                   "name": "Sample Order - 1, Detail - 1",
                   "budget": 123.0,
                   "approvedBy": null,
                   "startDate": "2020-05-11T04:30:45.123Z",
                   "endate": "2020-05-30T04:30:45.123Z"
               }
           ]
       },
       {
           "id": 1,
           "status": "PENDING",
           "advertiserId": "123",
           "hierarchyId": "200",
           "ownerEmail": "someEmail@domain.com",
           "name": "Sample Order - 2",
           "orderDetails": [
               {
                   "id": 12,
                   "status": "PENDING",
                   "name": "Sample Order - 2, Detail - 1",
                   "budget": 123.0,
                   "approvedBy": null,
                   "startDate": "2020-05-23T04:30:45.123Z",
                   "endDate": "2020-05-26T04:30:45.123Z"
               }
           ]
       }
   ]
}