Affinidi Iota Framework
Supported Languages
Package: @affinidi-tdk/iota-client
npm install @affinidi-tdk/iota-client --save
Package: affinidi_tdk_iota_client
pip install affinidi_tdk_iota_client
Classes and Methods
Configurations API
Manage Affinidi Iota Framework configurations to integrate your application to request data from Affinidi Vault.
createIotaConfiguration
Create an Affinidi Iota Framework configuration.
Parameters
CreateIotaConfigurationInput [Object]
JSON object to provide the configuration details. See more here.
Module Imports
import { ConfigurationsApi, Configuration, CreateIotaConfigurationInput } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new ConfigurationsApi(authConfiguration)
const request: CreateIotaConfigurationInput = {
name: "Sample App",
walletAri: "ari:identity:ap-southeast-1:af338c39-2201-49a6-90d2-106c6cbbbcb7:wallet/3ab087dba42f3255f5c7b95998b28026",
iotaResponseWebhookURL: "http://localhost"
}
const { data } = await api.createIotaConfiguration(request)
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.ConfigurationsApi(api_client)
request_json = {
name: "Sample App",
walletAri: "ari:identity:ap-southeast-1:af338c39-2201-49a6-90d2-106c6cbbbcb7:wallet/3ab087dba42f3255f5c7b95998b28026",
iotaResponseWebhookURL: "http://localhost"
}
create_iota_configuration_input = affinidi_tdk_iota_client.CreateIotaConfigurationInput.from_dict(request_json)
api_response = api_instance.create_iota_configuration(create_iota_configuration_input=create_iota_configuration_input)
deleteIotaConfigurationById
Delete existing Affinidi Iota Framework configuration by ID.
Parameters
configurationId [String]
ID of the Affinidi Iota Configuration to delete.
Module Imports
import { ConfigurationsApi, Configuration } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new ConfigurationsApi(authConfiguration)
const configurationId = "<Config_ID>"
const { data } = await api.deleteIotaConfigurationById(configurationId)
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.ConfigurationsApi(api_client)
configuration_id = "<Config_ID>"
api_instance.delete_iota_configuration_by_id(configuration_id)
getIotaConfigurationById
Retrieves existing Affinidi Iota Framework by ID.
Parameters
configurationId [String]
ID of the Affinidi Iota Configuration to delete.
Module Imports
import { ConfigurationsApi, Configuration } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new ConfigurationsApi(authConfiguration)
const configurationId = "<Config_ID>"
const result = await api.getIotaConfigurationById(configurationId)
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.ConfigurationsApi(api_client)
configuration_id = "<Config_ID>"
api_response = api_instance.get_iota_configuration_by_id(configuration_id)
getIotaConfigurationMetaData
Retrieves the Metadata of the existing Affinidi Iota Framework.
Parameters
projectId [String]
Project ID where the Affinidi Iota Framework was created.
configurationId [String]
ID of the existing Affinidi Iota Framework Configuration.
Module Imports
import { ConfigurationsApi, Configuration } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new ConfigurationsApi(authConfiguration)
const projectID = "<Project_ID>"
const configurationId = "<Config_ID>"
const { data } = await api.getIotaConfigurationMetaData(projectID, configurationId)
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.ConfigurationsApi(api_client)
project_id = "<Project_ID>"
configuration_id = "<Config_ID>"
api_response = api_instance.get_iota_configuration_metadata(project_id, configuration_id)
listIotaConfigurations
List all the Affinidi Iota Framework configurations.
Parameters
No Parameters Required
Module Imports
import { ConfigurationsApi, Configuration } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new ConfigurationsApi(authConfiguration)
const { data } = await api.listIotaConfigurations()
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.ConfigurationsApi(api_client)
api_response = api_instance.list_iota_configurations()
updateIotaConfigurationById
Update an existing Affinidi Iota Framework by ID.
Parameters
configurationId [String]
ID of the existing Affinidi Iota Framework Configuration.
UpdateConfigurationByIdInput [Object]
JSON object to provide the configuration details. See more here.
Module Imports
import { ConfigurationsApi, Configuration, UpdateConfigurationByIdInput } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new ConfigurationsApi(authConfiguration)
const configurationId = "<Config_ID>"
const request: UpdateConfigurationByIdInput = {
name: "Sample App",
walletAri: "ari:identity:ap-southeast-1:af338c39-2201-49a6-90d2-106c6cbbbcb7:wallet/3ab087dba42f3255f5c7b95998b28026",
iotaResponseWebhookURL: "http://localhost"
}
const { data } = await api.updateIotaConfigurationById(configurationId, request)
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.ConfigurationsApi(api_client)
configuration_id = "<Config_ID>"
request_json = {
name: "Sample App",
walletAri: "ari:identity:ap-southeast-1:af338c39-2201-49a6-90d2-106c6cbbbcb7:wallet/3ab087dba42f3255f5c7b95998b28026",
iotaResponseWebhookURL: "http://localhost"
}
update_iota_configuration_by_id_input = affinidi_tdk_iota_client.UpdateConfigurationByIdInput.from_dict(request_json)
api_response = api_instance.update_iota_configuration_by_id(configuration_id, update_iota_configuration_by_id_input=update_iota_configuration_by_id_input)
Iota API
Generate access token required to access the Affinidi Iota Framework.
awsExchangeCredentials
Exchanges limited token into a Cognito token.
Parameters
AwsExchangeCredentials [String]
JWT string. See more here.
Module Imports
import { IotaApi, Configuration, AwsExchangeCredentials } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new IotaApi(authConfiguration)
const request: AwsExchangeCredentials = {
name: "Sample App",
walletAri: "ari:identity:ap-southeast-1:af338c39-2201-49a6-90d2-106c6cbbbcb7:wallet/3ab087dba42f3255f5c7b95998b28026",
iotaResponseWebhookURL: "http://localhost"
}
const { data } = await api.AwsExchangeCredentials(request)
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.IotaApi(api_client)
request_json = {
name: "Sample App",
walletAri: "ari:identity:ap-southeast-1:af338c39-2201-49a6-90d2-106c6cbbbcb7:wallet/3ab087dba42f3255f5c7b95998b28026",
iotaResponseWebhookURL: "http://localhost"
}
aws_exchange_credentials = affinidi_tdk_iota_client.AwsExchangeCredentials.from_dict(request_json)
api_response = api_instance.aws_exchange_credentials(aws_exchange_credentials=aws_exchange_credentials)
Default API
Manage logged consent from Affinidi Iota Framework.
listLoggedConsents
Returns the list of logged consents for the project.
Parameters
configurationId [String]
Returns logged consent for the particular configuration.
userId [String]
Returns logged consent for the particular user.
limit [Integer]
Maximum number of records to fetch in a list.
exclusiveStartKey [String]
The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation.
Module Imports
import { DefaultApi, Configuration } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new DefaultApi(authConfiguration)
const { data } = await api.listLoggedConsents()
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.DefaultApi(api_client)
api_response = api_instance.list_logged_consents()
PexQueryAPI
createPexQuery
Creates a Presentation Definition in the Iota Configuration.
Parameters
configurationId [String]
ID of the existing Affinidi Iota Framework Configuration.
CreatePexQueryInput [Object]
JSON object to provide the PEX query details. See more here.
Module Imports
import { PexQueryApi, Configuration, CreatePexQueryInput } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new PexQueryApi(authConfiguration)
const configurationId = "<Config_ID>"
const request: CreatePexQueryInput = {
name: "Request Data",
vpDefinition: "{PRESENTATION_DEFINITION_JSON_STRING}"
}
const { data } = await api.createPexQuery(configurationId, request)
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.PexQueryApi(api_client)
configuration_id = "<Config_ID>"
request_json = {
name: "Request Data",
vpDefinition: "{PRESENTATION_DEFINITION_JSON_STRING}",
}
create_pex_query_input = affinidi_tdk_iota_client.CreatePexQueryInput.from_dict(request_json)
api_response = api_instance.create_pex_query(configuration_id, create_pex_query_input=create_pex_query_input)
deletePexQueryById
Deletes a Presentation Definition based on the queryId from the Iota Configuration.
Parameters
configurationId [String]
ID of the existing Affinidi Iota Framework Configuration.
queryId [String]
ID of the existing Presentation Definition of the Affinidi Iota Configuration.
Module Imports
import { PexQueryApi, Configuration } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new PexQueryApi(authConfiguration)
const configurationId = "<Config_ID>"
const queryId = "<Query_ID>"
const result = await api.deletePexQueryById(configurationId, queryId)
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.PexQueryApi(api_client)
configuration_id = "<Config_ID>"
query_id = "<Query_ID>"
api_response = api_instance.delete_pex_query_by_id(configuration_id, query_id)
getPexQueryById
Retrieves a Presentation Definition based on the queryId from the Iota Configuration.
Parameters
configurationId [String]
ID of the existing Affinidi Iota Framework Configuration.
queryId [String]
ID of the existing Presentation Definition of the Affinidi Iota Configuration.
Module Imports
import { PexQueryApi, Configuration } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new PexQueryApi(authConfiguration)
const configurationId = "<Config_ID>"
const queryId = "<Query_ID>"
const result = await api.getPexQueryById(configurationId, queryId)
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.PexQueryApi(api_client)
configuration_id = "<Config_ID>"
query_id = "<Query_ID>"
api_response = api_instance.get_pex_query_by_id(configuration_id, query_id)
listPexQueries
Retrieves all Presentation Definition in the Iota Configuration.
Parameters
configurationId [String]
ID of the existing Affinidi Iota Framework Configuration.
Module Imports
import { PexQueryApi, Configuration } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new PexQueryApi(authConfiguration)
const configurationId = "<Config_ID>"
const result = await api.listPexQueries(configurationId)
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.PexQueryApi(api_client)
configuration_id = "<Config_ID>"
api_response = api_instance.list_pex_queries(configuration_id)
updatePexQueryById
Updates a Presentation Definition based on the queryId from the Iota Configuration.
Parameters
configurationId [String]
ID of the existing Affinidi Iota Framework Configuration.
queryId [String]
ID of the existing Presentation Definition of the Affinidi Iota Configuration.
UpdatePexQueryInput [Object]
JSON object to provide the PEX query details. See more here.
Module Imports
import { PexQueryApi, Configuration, UpdatePexQueryInput } from '@affinidi-tdk/iota-client'
import affinidi_tdk_iota_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})
const api = new PexQueryApi(authConfiguration)
const configurationId = "<Config_ID>"
const queryId = "<Query_ID>"
const request: UpdatePexQueryInput = {
vpDefinition: "{PRESENTATION_DEFINITION_JSON_STRING}"
}
const result = await api.updatePexQueryById(configurationId, queryId, request)
configuration = affinidi_tdk_iota_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken
with affinidi_tdk_iota_client.ApiClient(configuration) as api_client:
api_instance = affinidi_tdk_iota_client.PexQueryApi(api_client)
configuration_id = "<Config_ID>"
query_id = "<Query_ID>"
request_json = {
vpDefinition: "{PRESENTATION_DEFINITION_JSON_STRING}",
}
update_pex_query_input = affinidi_tdk_iota_client.UpdatePexQueryInput.from_dict(request_json)
api_response = api_instance.create_pex_query(configuration_id, update_pex_query_input=update_pex_query_input)
api_response = api_instance.list_logged_consents()
Glad to hear it! Please tell us how we can improve more.
Sorry to hear that. Please tell us how we can improve.
Thank you for sharing your feedback so we can improve your experience.