Apologies if I look like someone who knows what he’s doing! I appreciate your help, @Arkshine and will continue looking for how to solve this.
This is absolutely a task I am under-prepared for, yet I am trying. ![]()
I was able to get the request to save by putting Api-Username and Api-Key inside quotes. Thank you Arkshine. I then executed the script via GTM then check my Discourse logs without anything to show.
No new user is being generated.
Any thoughts?
Here’s my final script in GTM:
<script type="text/javascript">
$.ajax({
method: "POST",
url: "https://test.co/invites",
headers: { "Api-Username": "system", "Api-Key": "1234556" },
data: { email: "test@gmail.com", group_names: "Paid_Members" }
})
.done(function( msg ) {
alert( "Data Saved: " + msg );
});
</script>