Overview
Retrieves detailed information about a specific attribute registered in the BOOP Network. This endpoint is useful for validating attribute configurations and understanding data format requirements.
This endpoint does not require authentication and can be used to verify attribute specifications before making authentication requests.
Path Parameters
The unique name of the attribute to retrieve (e.g., “email”, “age-verify”)
Response
Unique name of the attribute
Format specification for the attribute data (e.g., “string”, “boolean”, “object”)
Format specification for additional context data (optional)
Whether modification of this attribute requires attestation from a trusted entity
200 - Success
200 - Complex Attribute
404 - Not Found
{
"name" : "email" ,
"data-format" : "string" ,
"context-format" : null ,
"attestation-required" : false
}
Usage Examples
async function getAttributeDetails ( attributeName ) {
const response = await fetch (
`https://dev.app.boop.it/api/v1/attributes/ ${ attributeName } `
);
if ( ! response . ok ) {
if ( response . status === 404 ) {
throw new Error ( `Attribute ' ${ attributeName } ' not found` );
}
throw new Error ( `Failed to fetch attribute: ${ response . statusText } ` );
}
return await response . json ();
}
// Validate attribute before use
async function validateAttributeRequest ( attributeName ) {
try {
const attr = await getAttributeDetails ( attributeName );
if ( attr [ 'attestation-required' ]) {
console . warn ( `Attribute ' ${ attributeName } ' requires attestation` );
}
return {
name: attr . name ,
format: attr [ 'data-format' ],
requiresAttestation: attr [ 'attestation-required' ]
};
} catch ( error ) {
console . error ( `Invalid attribute: ${ error . message } ` );
return null ;
}
}
Attribute Validation
Use this endpoint to validate attributes before authentication requests:
async function validateAuthenticationAttributes ( requiredAttributes ) {
const validationResults = await Promise . all (
requiredAttributes . map ( async ( attrName ) => {
try {
const attr = await getAttributeDetails ( attrName );
return {
name: attrName ,
valid: true ,
requiresAttestation: attr [ 'attestation-required' ],
dataFormat: attr [ 'data-format' ]
};
} catch ( error ) {
return {
name: attrName ,
valid: false ,
error: error . message
};
}
})
);
const invalidAttributes = validationResults . filter ( result => ! result . valid );
const attestationRequired = validationResults . filter (
result => result . valid && result . requiresAttestation
);
return {
valid: invalidAttributes . length === 0 ,
invalidAttributes ,
attestationRequired ,
validAttributes: validationResults . filter ( result => result . valid )
};
}
// Usage in authentication setup
const validation = await validateAuthenticationAttributes ([
'email' , 'age-verify' , 'payment-method'
]);
if ( ! validation . valid ) {
console . error ( 'Invalid attributes:' , validation . invalidAttributes );
}
String Attributes
{
"name" : "username" ,
"data-format" : "string" ,
"context-format" : null ,
"attestation-required" : false
}
Boolean Attributes
{
"name" : "marketing-consent" ,
"data-format" : "boolean" ,
"context-format" : null ,
"attestation-required" : false
}
Object Attributes
{
"name" : "billing-address" ,
"data-format" : "object" ,
"context-format" : "json" ,
"attestation-required" : true
}
Integration Patterns
async function buildAttributeForm ( attributeNames ) {
const formFields = await Promise . all (
attributeNames . map ( async ( name ) => {
const attr = await getAttributeDetails ( name );
return {
name: attr . name ,
type: attr [ 'data-format' ],
required: true ,
attestationWarning: attr [ 'attestation-required' ]
};
})
);
return formFields ;
}
Attribute Compatibility Check
async function checkAttributeCompatibility ( vendorRequirements ) {
const compatibility = {};
for ( const attrName of vendorRequirements ) {
try {
const attr = await getAttributeDetails ( attrName );
compatibility [ attrName ] = {
supported: true ,
requiresAttestation: attr [ 'attestation-required' ],
dataFormat: attr [ 'data-format' ]
};
} catch ( error ) {
compatibility [ attrName ] = {
supported: false ,
error: error . message
};
}
}
return compatibility ;
}
Caching Strategy
Since attribute definitions change infrequently, implement caching:
class AttributeCache {
constructor ( ttl = 300000 ) { // 5 minutes
this . cache = new Map ();
this . ttl = ttl ;
}
async get ( attributeName ) {
const cached = this . cache . get ( attributeName );
if ( cached && Date . now () - cached . timestamp < this . ttl ) {
return cached . data ;
}
try {
const data = await getAttributeDetails ( attributeName );
this . cache . set ( attributeName , {
data ,
timestamp: Date . now ()
});
return data ;
} catch ( error ) {
// Cache negative results for shorter time
this . cache . set ( attributeName , {
data: null ,
timestamp: Date . now (),
error: error . message
});
throw error ;
}
}
}
Error Handling
Status Code Meaning Handling 200 Attribute found Process attribute details 404 Attribute not found Check spelling, update requirements 500 Server error Retry request, check system status
Rate Limits
1000 requests per minute per IP address
No authentication required for this endpoint