Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
227d62a5
Commit
227d62a5
authored
Mar 10, 2022
by
Nikolaj Brinch Jørgensen
Browse files
Fixes Simply.com to use REST API version 2 with Basic Auth
parent
7fae5553
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_simply.sh
View file @
227d62a5
...
...
@@ -5,8 +5,8 @@
#SIMPLY_AccountName="accountname"
#SIMPLY_ApiKey="apikey"
#
#SIMPLY_Api="https://api.simply.com/
1/[ACCOUNTNAME]/[APIKEY]
"
SIMPLY_Api_Default
=
"https://api.simply.com/
1
"
#SIMPLY_Api="https://api.simply.com/
2/
"
SIMPLY_Api_Default
=
"https://api.simply.com/
2
"
#This is used for determining success of REST call
SIMPLY_SUCCESS_CODE
=
'"status":200'
...
...
@@ -237,12 +237,18 @@ _simply_rest() {
_debug2 ep
"
$ep
"
_debug2 m
"
$m
"
export
_H1
=
"Content-Type: application/json"
basicauth
=
$(
printf
"%s:%s"
"
$SIMPLY_AccountName
"
"
$SIMPLY_ApiKey
"
| _base64
)
if
[
"
$basicauth
"
]
;
then
export
_H1
=
"Authorization: Basic
$basicauth
"
fi
export
_H2
=
"Content-Type: application/json"
if
[
"
$m
"
!=
"GET"
]
;
then
response
=
"
$(
_post
"
$data
"
"
$SIMPLY_Api
/
$
SIMPLY_AccountName
/
$SIMPLY_ApiKey
/
$
ep
"
""
"
$m
"
)
"
response
=
"
$(
_post
"
$data
"
"
$SIMPLY_Api
/
$ep
"
""
"
$m
"
)
"
else
response
=
"
$(
_get
"
$SIMPLY_Api
/
$
SIMPLY_AccountName
/
$SIMPLY_ApiKey
/
$
ep
"
)
"
response
=
"
$(
_get
"
$SIMPLY_Api
/
$ep
"
)
"
fi
if
[
"
$?
"
!=
"0"
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment