Loading ...

The Post wall API does not work | Communifire Support

Home » Spaces » Communifire Support » forum » Communifire API & Developers » The Post wall API does not work
Communifire Support

Leave Space :

Are you sure you want to leave this space?

Join this space:

Join this space?

Add a new tab

Add a hyperlink to the space navigation. You can link to internal or external web pages. Enter the Tab name and Tab URL. Upload or choose an icon. Then click Save.

The name that will appear in the space navigation.
The url can point to an internal or external web page.
Login to follow, share, and participate in this space.
Don’t have a support community login?Create your account now
Posted in: Communifire API & Developers

The Post wall API does not work

Subscribe to RSS
  • victorit

    Hello,

    I user Raw HTML button.

    I inserted following code to Raw HTML:

    <button type="button" id="API Test" onclick=function()"> API Test</button>

    <script type="text/javascript">

    function()

    {

    var ItemJSON;

    ItemJSON = {

    "WallText": "text"

    };

    var url_link = "My url site/api/wall";

    var xhttp = new XMLhttpRequest();

    xhttp.open("POST", url_link);

    xhttp.setRequestHeader("Content-Type", "application/json");

    xhttp.setRequestHeader("Rest-Api-Key", key);

    xhttp.send(ItemJSON);

    }

    </script>

    After pressing on the button I expect to view the new Wall Post in Active Stream. But nothing happen.

    Why? Please, your help.

    Thank you

    Viktorya

  • Foster

    Hi Viktorya,

    I am investigating the issue. I will update you once I have a solution.

    Thank you for your patience.

  • Foster
    Answered

    Hi Viktorya,

    Below is the javascript you can put into your Raw HTML widget. The button will post to the currently logged in users wall. You can change the data section to change what will post on the wall.

     

    <button type="button" onclick="createPost()"> API Test </button>
    
    <script>
    function createPost(){
    
    $.ajax({
            type: "POST",
            url: "yourURLhere/api/wall",
            data : JSON.stringify({"WallText": "Hello Everyone!"}),
            contentType:"application/json; charset=utf-8",
            dataType: "JSON",
            success: function(response){
    } }); } </script>

     

    I hope this helps!

    - Foster

  • victorit

    Thank you for your help. 

Page 1 of 1 (4 items)