Getting campaign reports

Hi,

I’m trying to get campaign reports out of IdentityNow using API - I’ve done this before using private/v1 APIs but have the opportunity to rework it using v3 APIs.

However, having issues with these APIs:

  1. Get Campaign Reports is listed in the documentation for v3 api, however when I attempt to call it via /v3/campaigns/{{campaignId}}/reports
    I receive a 404 response:
{
    "error": "No message available"
}
  1. Get Campaign Reports, when accessed via the working beta endpoint, the response I get back doesn’t match the documentation:

Documentation:

[
  {
    "type": "REPORT_RESULT",
    "id": "2c91808568c529c60168cca6f90c1313",
    "name": "Campaign Composition Report",
    "status": "SUCCESS",
    "reportType": "CAMPAIGN_COMPOSITION_REPORT",
    "lastRun": "2019-12-19T13:49:37.385Z"
  }
]

Actual:

[
    {
        "lastRun": 1612414719233,
        "reportType": "CAMPAIGN_COMPOSITION_REPORT",
        "name": "Campaign Composition Report",
        "status": "SUCCESS"
    },
]

Is the documentation incorrect? Or am I making a call incorrectly? or is this a bug? Because the response I’m receiving doesn’t look like a v3 API call response. It’s also missing the report id which is kind of important.
The request URL I used to get this response is:
https://{{orgname}}.api.identitynow.com/beta/campaigns/{{campaignid}}/reports

  1. How do I actually retrieve the report? There doesn’t appear to be an API call for downloading the report. Do I need to use the old v1 API for this or is there a v3 API available?

Hi Ramiro,

I’m not finding a v3 version of campaign reports in our portal. Do you have a link you can share that points us to the v3 endpoint?

As for the beta endpoint, you are correct, the documentation does not match the actual result. This is a bug and I’m going to get this fixed. I’m also going to ask about the lack of an endpoint to download the report. You’re right, it should have a way to download the report. Thank you for bringing these issues to our attention!

Hi Colin,

Thanks for the response.

  1. I’m not sure what I was looking at, but just looked again and yup it’s not there in the v3 doco - my bad!
  2. When you say you’re going to get the bug fixed, do you mean the documentation is a bug or the API behaviour is a bug? And when might this be fixed?
  3. Should we post this in the ideas portal or will this be added into the backlog for delivery based on this request?

Thanks,
Ramiro

In this case the API spec is incorrect. The api spec will need to be updated to reflect what the server is actually returning. However, I have requested the engineering team to use a date time type instead of Unix epoch for the lastRun field, since date time is standard for all of our beta/v3 APIs. This will break any existing users of this beta endpoint though, so we will need to consider how we want to proceed. If we do plan on changing it, it will be announced in the announcements channel.

For the download report endpoint, I’m talking to engineering directly at the moment to see when they can get to it. No need for an idea at this time. If one is needed then I will create it.

Thanks Colin - I honestly think the API implementation is pretty bad compared to the spec. Aside from the unix epoch issue described, it’s also missing the id. In fact the only useful information it returns is the “lastRun”

So I can’t even use this endpoint as it is, because without the ID I can’t download the report. This means I have to go back to using the unsupported private APIs for all report based calls, which is a disappointment.

I hope if you’re talking to the engineering team about adding a “retrieve report” API call, you can also ensure that the “get campaign reports” API call can also provide the required information for making this call :slight_smile:

Yes, good catch. I have updated the ticket to make sure all necessary information for retrieving reports is in the response.

2 Likes

Hi Colin, has an API been released that lets us download the actual report results?

1 Like

I am also in need of retrieving these reports via API - roadmap on this?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

You can now use get-report | SailPoint Developer Community to download report files. The exact steps to download a campaign report are as follows:

  1. Use get-active-campaigns | SailPoint Developer Community to find a completed campaign.
  2. Use get-campaign-reports | SailPoint Developer Community to get the ID of one of the reports generated for the campaign.
  3. Use get-report | SailPoint Developer Community to download the report file in either CSV or PDF format