Giter Site home page Giter Site logo

adaptiveapi's Introduction

adaptiveapi

Lifecycle: experimental License: MIT Project Status: Concept – Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept.

The goal of adaptiveapi is to support access to Workday Adaptive Planning’s API using the {httr2} and {xml2} packages.

Installation

You can install the development version of adaptiveapi like so:

pak::pkg_install("elipousson/adaptiveapi")

Usage

The Adaptive Planning REST API uses XML files as the body of HTTP POST requests.

This package has a helper function req_body_xml() that takes an xml_document object, writes the document to disk, and includes the file in the POST request. The package also includes helper functions for creating the request, validating the API method, and including the username and password in the XML to authenticate the request.

However, as of April 2024, this package is a bare-bones experiment that only includes a template for the exportCustomerLogo API method.

library(adaptiveapi)

req <- adaptive_request() |> 
  adaptive_req_method(
  method = "exportCustomerLogo",
  username = Sys.getenv("ADAPTIVE_USERNAME"),
  password = Sys.getenv("ADAPTIVE_PASSWORD")
)

resp <- httr2::req_perform(req)

resp |> 
  httr2::resp_body_xml() |> 
  xml2::as_list()

The username and password should be stored as environmental variables as illustrated in the example below. The password can be encrypted by using httr2::secret_make_key() to generate a key and httr2::secret_encrypt() to encrypt the password. The key, username, and password can be stored as environmental variables with usethis::edit_r_environ().

At present, this package does not include the Adaptive Planning JSON API or any support for using the API with Workday Credentials although the latter feature may be added in the future.

adaptiveapi's People

Contributors

elipousson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.