success!
This commit is contained in:
parent
8d4ee36c44
commit
dd49390aa0
@ -3,7 +3,7 @@ https://help.deltek.com/Product/Ajera/api/projects.html#messages-api-endpoint-po
|
||||
|
||||
|
||||
#>
|
||||
$MPE_Ajera_URI = "https://192.168.2.19/ajera/AjeraAPI.ashx"
|
||||
$MPE_Ajera_URI = "https://ajera.mpe.ca/ajera/AjeraAPI.ashx?ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhIg0KfQ%3d%3d"
|
||||
$Headers = @{
|
||||
'Content-Type' = 'application/json'
|
||||
Accept = 'application/json'
|
||||
@ -13,15 +13,13 @@ function Connect-Ajera {
|
||||
$Session_Body = @{
|
||||
Method = "CreateAPISession"
|
||||
Username = "MMIntegration"
|
||||
Password = "DeluxeMXD74!"
|
||||
Password = "@s0Nny2day"
|
||||
APIVersion = 2
|
||||
UseSessionCookie = $false
|
||||
} | ConvertTo-Json
|
||||
|
||||
|
||||
|
||||
$session_token_URI = $MPE_Ajera_URI + '?' + $MPE_Ajera_API_Token
|
||||
$Session_token = Invoke-WebRequest -Uri $session_token_URI -Method Post -Body $Session_Body -Headers $Headers -SkipCertificateCheck
|
||||
$Session_token = Invoke-WebRequest -Uri $MPE_Ajera_URI -Method Post -Body $Session_Body -Headers $Headers -SkipCertificateCheck
|
||||
|
||||
return $Session_token
|
||||
}
|
||||
@ -43,20 +41,20 @@ function Disconnect-Ajera {
|
||||
if (!($APIKey)) {
|
||||
# get session api key if not already loaded
|
||||
$Session = Connect-Ajera
|
||||
$APIKey = ($Session.Content | ConvertFrom-Json).UsageKey
|
||||
$resp = $Session.Content | ConvertFrom-Json
|
||||
$APIKey = $resp.Content.SessionToken
|
||||
}
|
||||
|
||||
$API_URI = $MPE_Ajera_URI + '?' + $APIKey
|
||||
|
||||
|
||||
$req_body = @{
|
||||
Method = 'GetProjects'
|
||||
Method = 'ListProjects'
|
||||
SessionToken = $APIKey
|
||||
MethodArguments = @{
|
||||
FilterByStatus = '["Active", "Hold"]'
|
||||
FilterByStatus = @("Active")
|
||||
}
|
||||
} | ConvertTo-Json
|
||||
|
||||
|
||||
$resp = Invoke-WebRequest -Uri $API_URI -Headers $Headers -Body $req_body -Method Post -SkipCertificateCheck
|
||||
$resp = Invoke-WebRequest -Uri $MPE_Ajera_URI -Headers $Headers -Body $req_body -Method Post -SkipCertificateCheck
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user