Employee Updater API, Using PowerShell

derekritchison
derekritchison Expensify Customer Posts: 6 Expensify Newcomer

Hey all, I posted this question in a somewhat relevant thread but hadn't received a response, possibly because the thread was a bit old. Anyway, I am working on automating new user creation with my onboarding script, which is written in PowerShell. I've pieced together quite a bit just from reading questions in this community, but I'm now stuck trying to figure out how to properly translate the "send the CSV" portion of the curl. Here's how I'm writing the JSON, but if anyone has any experience with the "data" portion that would be terrific.

$json = [ordered]@{

    "requestJobDescription" = @{

            "type" = "update";

           "credentials" = @{

                    "partnerUserID" = $expensify_id;

                    "partnerUserSecret" = $expensify_secret;

            }

            "inputSettings" = @{

                    "type" = "employees";

                    "policyID" = "$policy_ID";

                    "fileType" = "csv";

            }

        };

    "data" = "C:\expensify.csv";

    } | ConvertTo-Json -Depth 5

Best Answer

Answers