Skip to content

Commit dc39c38

Browse files
authored
Create update.ps1
Add info on how to use credentials/logins API
1 parent 37e85ca commit dc39c38

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

credentials/update.ps1

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# ITFlow API - PowerShell examples
2+
# https://itflow.org
3+
4+
# Update credential(s)
5+
6+
# API Key
7+
$apiKey = "a1wEoh1F3omPhea6"
8+
9+
# Credential decryption key
10+
$credKey = "JKyA0daoyOv7oKpw"
11+
12+
# Base site URL
13+
$siteUrl = "https://demo.itflow.org"
14+
15+
# Data
16+
# Required fields are API Key, API Decryption Key, Login ID and Client ID
17+
# Only specify the fields you need to update, see create.ps1 for column names
18+
$body = @"
19+
{
20+
"api_key" : "$apiKey",
21+
"api_key_decrypt_password" : "$credKey",
22+
"login_id" : "6",
23+
"login_username" : "new_username",
24+
"login_password" : "changedPassword-123",
25+
"client_id" : "1"
26+
}
27+
"@
28+
29+
# Module / Endpoint
30+
$module = "/api/v1/credentials/update.php"
31+
32+
# Build URI from defined data
33+
$uri = $siteUrl + $module
34+
35+
# Request
36+
# Use Invoke-WebRequest instead to see more info about the request/response
37+
Invoke-RestMethod -Method Post -Uri $uri -Body $body

0 commit comments

Comments
 (0)