Additional Resources
- The code for this presentation is here: GitHub - colin-mckibben-sp/api-reporting-examples: Examples of how to do SailPoint IDN reporting using APIs
Hi Colin,
Thanks for sharing this.
Was that a typo in the script for uncorrelated accounts ? filters: āuncorrelated eq trueāā
I was unable to export sourceName from account.source but it exports if we donāt choose the columns.
Could you please help on that ?
Welcome to the developer community Antony.
Iām having trouble identifying the line of code that is giving you issues. Do you mind opening an issue for this and referencing the exact portion of code that is causing you issues? Issues Ā· colin-mckibben-sp/api-reporting-examples Ā· GitHub
Hey Colin
Not a issue but I would like to know how to export column āsourceNameā ?
Intellisense is not showing accounts.sourceName but only sourceId
let accounts = val.data.map(account => {
return{
name: account.name,
email: account.attributes!["e-mail"],
manager: account.attributes!["manager"],
uncorrelated: account.uncorrelated,
source: account.sourceId //working
sourceName: account.sourceName //not working <----------
}
Looks like the list accounts endpoint has a documentation issue. It doesnāt list sourceName
as a field that is returned by the API, but I just ran the endpoint and it does indeed return sourceName
. Since the SDK is built from the spec, Iāll have to fix the spec first. Once itās fixed in the spec and the new SDK version is built, you should be able to upgrade your SDK and see sourceName
in intellisense then.
Thanks for the quick response, Colin.
This will be really helpful. Please let us know once the spec is fixed.
Weāre excited that youāre using the SDK, Antony. I canāt wait to hear what you think and see what you build!
@antony_petson The latest SDK version is live. It should now show sourceName
in intellisense. sailpoint-api-client - npm
Great, thanks for the quick fix Colin.
Similarly externalId: source.connectorAttributes?.cloudExternalId
is not working but cluster: source.cluster?.name
is working just fine.
let sources = val.data.map(source => {
return{
name: source.name,
id: source.id,
externalId: source.connectorAttributes?.cloudExternalId,
connectionType:source.type,
isAuthorative: source.authoritative,
cluster: source.cluster?.name,
threshold: source.deleteThreshold,
status: source.status,
}
})
Appreciate your work!
@derek_putnam I am starting with essential reports for audit team. Also, looking forward to build a dashboard to track our certification campaigns (for now, we are trying to build on Power BI but if SP has some recommendations or any OOTB in pipeline, that would be best)
Many Thanks,
Antony.
@antony_petson connector attributes vary by source type, so we canāt feasibly model them in the API specification. This means the SDK will represent connectorAttributes
as the type object
, which doesnāt have any information about the properties that it could contain. If you ever come across a type of object
in the SDK, you can quickly get past this by casting the property into a type of any
and then manually specifying the path to the child property.
(source.connectorAttributes as any)['cloudExternalId']
You can see a full example below.
export const sources = async () => {
let apiConfig = new Configuration()
let api = new SourcesApi(apiConfig)
const val = await Paginator.paginate(api, api.listSources, undefined, 250)
let sources = val.data.map(source => {
return {
name: source.name,
externalId: (source.connectorAttributes as any)['healthCheckTimeout']
}
})
return sources
}
Hi @colin_mckibben
I was trying to pull all the entitlements with tags using TaggedObjectsBetaApi and then finding the entitlements within the result as privileged or not.
I was able to get tagged object but while calling the EntitlementsBetaApi, I am getting
Function used
export const checkPriv = async(entId:any) => {
let apiConfig = new Configuration()
let apiEnt = new EntitlementsBetaApi(apiConfig)
const val = await apiEnt.getEntitlement({id:entId})
let priv = val.data.privileged
console.log(priv,entId)
return priv
Response
Paginating call, offset = 0
{
tagName: [ 'SOX' ],
objectId: 'abcfresponse5c5aedited6e898ec',
privileged: Promise { <pending> },
objectType: 'ENTITLEMENT'
}
However, console.log is giving correct value after few seconds of executing the code.