lib4ap

Crates.iolib4ap
lib.rslib4ap
version0.1.3
sourcesrc
created_at2022-06-28 07:47:23.652682
updated_at2022-06-28 07:47:23.652682
descriptionAPI client for 4ALLPORTAL
homepage
repositoryhttps://github.com/BonMercato/lib4ap
max_upload_size
id614682
size14,008
cozyGalvinism (cozyGalvinism)

documentation

README

lib4ap

crate-badge docs-badge

This crate provides a client for the 4ALLPORTAL API. In order to be able to use this client, you will need a valid API key for a 4ALLPORTAL instance. Username and password authentication is not supported and will not be implemented.

NOTE: So far, only objects are implemented with more support coming in the future.

Getting started

use lib4ap::ScopedClient;

#[tokio::main]
async fn main() {
    let pim_url = std::env::var("PIM_URL").expect("PIM_URL must be set");
    let api_key = std::env::var("API_KEY").expect("API_KEY must be set");
    let module = std::env::var("MODULE").expect("MODULE must be set");

    let product_client = ScopedClient(&pim_url, &api_key, &module);
    let products = product_client.get_all_objects(vec!["id", "name"], None, Some(25));
}

License: LGPL-3.0-only

Commit count: 18

cargo fmt