Get Leads/Reports
/appstore/publisher/v1/leads
- One is to get Leads
- other is to get Leads Report
It is the "groupby" query parameter which differentiates the get leads call and leads report call.If "groupby" query parameter is specified then it is considered as report related call and depending on the value of grouby, we give 3 different kinds of report.
Request
-
createdonrangeend(optional): string
This is a filter option used to get the result set created within the given date range.
-
createdonrangestart(optional): string
This is a filter option used to get the result set created after the given date.
-
groupby(optional): string
This query parameter serves two purpose. One if it is present, then the api call is considered as report related call. Two, depending on the value, it tell what report related detail is required.Acceptable values are DATE, STATUS, LISTING.
-
keyword(optional): string
This is a filter option used to get the result set with specified keyword.
-
limit(optional): integer(int32)
Limit tells how many records to return (starting from the offset). Limit should be greater than zero and less than or equal to 100 (default=30).
-
listingtype(optional): string
This is a filter option used to get the result set of specified listingtype.Acceptable values are APPLICATION , SERVICE.
-
offset(optional): integer(int32)
Offset and limit together determine how many records to return from the collection. Offset is the starting index of the records to return, which should be greater than or equal to zero (default=0).
-
orderby(optional): string
This property sorts the result set. Acceptable values are NAME, COMPANY, LAST_NAME, FIRST_NAME,LASTMODIFIED_DATE and CREATION_DATE
-
sortorder(optional): string
This property specifies the order in which to sort the result set. Acceptable values are ASC and DESC.
-
status(optional): string
It is a multi-valued parameter.This is a filter option used to get the result set of specified status.Acceptable values are NEW,CONTACTED,PURCHASED,DELIVERED.
-
timetype(optional): string
This query parameter is applicable only when "groupby=date", else it will be ignored. Acceptable values are MONTHLY, WEEKLY, DAILY.
Response
- application/json;qs=1
- application/xml;qs=.5
200 Response
object
-
additionalNotes(optional):
string
-
company(optional):
string
-
companyAddress(optional):
string
-
creationDate(optional):
string(date-time)
-
email(optional):
string
-
firstName(optional):
string
-
lastModifiedBy(optional):
string
-
lastModifiedDate(optional):
string
-
lastName(optional):
string
-
leadCount(optional):
object leadCount
Additional Properties Allowed: additionalPropertiesUsed for leads related reports. Map with leadstatus and count as key and value.
-
leadId(optional):
integer(int64)
-
links(optional):
array link
-
listingId(optional):
integer(int64)
-
listingName(optional):
string
-
listingUrl(optional):
string
-
phone(optional):
string
-
status(optional):
string
-
telephoneExtension(optional):
string
object
object
-
href(optional):
string
-
rel(optional):
string
Allowed Values:
[ "SELF", "CANONICAL", "NEXT", "TEMPLATE", "PREV" ]
400 Response
401 Response
404 Response
500 Response
Examples
This api serves two purpose.
1. Fetching Leads
2. Fetching Lead Reports
1.Fetching Leads
The following example gets leads for a partner, by submitting a GET request on the REST resource using cURL.
Query Paramters supported for fetching leads related informations
1. createdOnRangeStart : YYYY-MM-DD 2. createdOnRangeEnd : YYYY-MM-DD 3. orderby : NAME, COMPANY, LAST_NAME, FIRST_NAME, CREATION_DATE,LASTMODIFIED_DATE 4. sortorder : ASC, DESC 5. keyword : any valid string 6. listingtype : APPLICATION, SERVICE 7. status : NEW, CONTACTED, PURCHASED, DELIVERED (Multi-valued parameter)
cURL Example
curl -X GET -H "X-Oracle-UserId: partner-email" -H "Authorization: Bearer Access-token" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/leads?limit=1&createdonrangestart=2016-01-01&createdonrangeend=2018-05-01&orderby=name&sortorder=ASC&listingtype=application&status=new&keyword=appstore"
Request Header
X-Oracle-UserId: fname.lname@oracle.com Authorization: Bearer Access-token
Request Body
None
HTTP Status Code:
200 OK
JSON Response:
{ "items": [ { "lead": { "status": "New", "firstName": "FN1", "lastName": "LN1", "email": "appstore-admin_in@oracle.com", "phone": "68768766871", "telephoneExtension": "11", "company": "Oracle1", "companyAddress": "vijayawada Patamata1", "additionalNotes": "111", "listingName": "App Listing 01", "listingId": 2241385, "creationDate": "2017-03-30T06:36:29.000Z", "listingUrl": "https://ocm-apis-stage-cloud.oracle.com/appstore/publisher/v1/applications/2241385", "leadId": 2241519, "lastModifiedBy": "appstore-admin_in appstore-admin_in", "lastModifiedDate": "2017-03-30T06:36:57.895Z" } } ], "hasMore": true, "count": 1, "totalResults": 7, "links": [ { "rel": "CANONICAL", "href": "https://ocm-apis-stage-cloud.oracle.com/appstore/publisher/v1/leads" }, { "rel": "SELF", "href": "https://ocm-apis-stage-cloud.oracle.com/appstore/publisher/v1/leads?limit=1&createdonrangestart=2016-01-01&createdonrangeend=2018-05-01&orderby=name&sortorder=ASC&listingtype=application&status=new&keyword=appstore" }, { "rel": "NEXT", "href": "https://ocm-apis-stage-cloud.oracle.com/appstore/publisher/v1/leads?createdonrangestart=2016-01-01&createdonrangeend=2018-05-01&listingtype=application&orderby=name&sortorder=ASC&keyword=appstore&status=new&offset=1&limit=1" } ] }
2.Fetching Lead Reports
The following example fetched lead reports for a partner, by submitting a GET request on the REST resource using cURL.
Query Paramters supported for fetching leads report related information
1. createdOnRangeStart: YYYY-MM-DD'T'HH:mmXXX i.e 2017-01-01T10:20+01:00" 2. createdOnRangeEnd: YYYY-MM-DD'T'HH:mmXXX i.e 2017-10-01T10:20+01:00" 3. groupby : DATE, STATUS, LISTING 4. timetype : MONTHLY, WEEKLY, DAILY
It the "groupby" queryparam which differentiates the get leads call and leads report call.
If "groupby" queryparam is specified then it is considered as report related call and depending on the value of grouby, we give 3 different kinds of report information
a. Total number of leads generated by date-wise(daily/weekly/monthly)
b. Total number of leads generated per status on given time range.
c. Total number of leads generated per listing on a given time-range.
2a. Total number of leads generated by date-wise(groupby=date)
timetype is applicable only for this report. when it is not mentioned default value is daily.
cURL Example
curl -X GET -H "X-Oracle-UserId: partner-email" -H "Authorization: Bearer Access-token" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/leads?groupby=date&timetype=monthly&createdonrangestart=2014-10-01T00:00-05:30&createdonrangeend=2015-10-01T00:00-05:30"
Request Header
X-Oracle-UserId: fname.lname@oracle.com Authorization: Bearer Access-token
Request Body
None
HTTP Status Code:
200 OK
JSON Response:
{ "items":[ { "lead":{ "leadCount":{ "2017-01-01":0, "2017-02-01":0, "2017-03-01":0, "2017-04-01":0, "2017-05-01":0, "2017-06-01":0, "2017-07-01":2 } } } ], "hasMore":false, "count":1, "totalResults":1, "links":[ { "rel":"CANONICAL", "href":"https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/leads" }, { "rel":"SELF", "href":"https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/leads?groupby=date&timetype=monthly&createdonrangestart=2014-10-01T00:00-05:30&createdonrangeend=2015-10-01T00:00-05:30" } ] }
2b. Total number of leads generated per status on given time range(groupby=status)
cURL Example
curl -X GET -H "X-Oracle-UserId: partner-email" -H "Authorization: Bearer Access-token" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/leads?groupby=status&createdonrangestart=2014-10-01T00:00-05:30&createdonrangeend=2015-10-01T00:00-05:30"
Request Header
X-Oracle-UserId: fname.lname@oracle.com Authorization: Bearer Access-token
Request Body
None
HTTP Status Code:
200 OK
JSON Response:
{ "items":[ { "lead":{ "leadCount":{ "New":9, "Contacted":0, "Purchased":1, "Delivered":1 } } } ], "hasMore":false, "count":1, "totalResults":1, "links":[ { "rel":"CANONICAL", "href":"https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/leads" }, { "rel":"SELF", "href":"https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/leads?groupby=status&createdonrangestart=2014-10-01T00:00-05:30&createdonrangeend=2015-10-01T00:00-05:30" } ] }
2c. Total number of leads generated per listing on a given time-range(groupby=listing)
cURL Example
curl -X GET -H "X-Oracle-UserId: partner-email" -H "Authorization: Bearer Access-token" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/leads?groupby=listing&createdonrangestart=2014-10-01T00:00-05:30&createdonrangeend=2015-10-01T00:00-05:30"
Request Header
X-Oracle-UserId: fname.lname@oracle.com Authorization: Bearer Access-token
Request Body
None
HTTP Status Code:
200 OK
JSON Response:
{ "items":[ { "lead":{ "listingName":"Compute TNC V6", "leadCount":{ "New":1, "Contacted":0, "Purchased":0, "Delivered":0 } } }, { "lead":{ "listingName":"Download TNC - 4", "leadCount":{ "New":1, "Contacted":0, "Purchased":0, "Delivered":0 } } }, { "lead":{ "listingName":"Downloadable package with download information", "leadCount":{ "New":0, "Contacted":0, "Purchased":0, "Delivered":1 } } }, { "lead":{ "listingName":"ICS OEP Listing", "leadCount":{ "New":1, "Contacted":0, "Purchased":0, "Delivered":0 } } }, { "lead":{ "listingName":"No Publisher TNC Download Pkg", "leadCount":{ "New":6, "Contacted":0, "Purchased":1, "Delivered":0 } } } ], "hasMore":false, "count":5, "totalResults":5, "links":[ { "rel":"CANONICAL", "href":"https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/leads" }, { "rel":"SELF", "href":"https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/leads?groupby=listing&createdonrangestart=2017-01-01&createdonrangeend=2017-10-01" } ] }Back to Top