Hello,
I am using Adobe data collection Reactor API, and want to know if following is possible, and if yes, how:
Can I extract all the libraries published in 2023 from my adobe launch property?
I am using following code, but it just extracts current libraries:
https://reactor.adobe.io/properties/{PROPERTY_ID}/libraries
Views
Replies
Total Likes
Hey @SaurabhCh ,
Collection Reactor API, you need to modify your API request to filter the libraries based on their publishing dates. The basic API endpoint you're using (https://reactor.adobe.io/properties/{PROPERTY_ID}/libraries) fetches the libraries associated with a specific property, but without additional filtering, it returns the current set of libraries.
API Documentation:
Filtering by Date:
Pagination Handling:
API Request Example:
A modified API request might look something like this (note that this is a hypothetical example as the exact parameter names and formats depend on the API's specification):
This assumes that published_after and published_before are valid query parameters for filtering by date, which you need to verify in the documentation.
Scripting the Extraction:
Error Handling and Validation:
Here's a basic JavaScript example using fetch to illustrate how you might structure the request. Note that this is a generic template:
const PROPERTY_ID = 'your-property-id'; // Replace with your Property ID
const url = `https://reactor.adobe.io/properties/${PROPERTY_ID}/libraries?published_after=2023-01-01&published_before=2024-01-01`;
fetch(url, {
headers: {
'Authorization': 'Bearer your-access-token', // Replace with your access token
'Content-Type': 'application/vnd.api+json'
}
})
.then(response => response.json())
.then(data => {
console.log('Libraries Published in 2023:', data);
})
.catch(error => {
console.error('Error fetching libraries:', error);
});
Finally, if you're unable to find the required filtering capability in the existing API, consider retrieving all libraries and then filtering them based on the publishing date within your script. This approach, however, might be less efficient, especially if there are a large number of libraries.
Regards,
Eugene
Views
Replies
Total Likes