I am brand new to PushWoosh and trying to figure out implementation with JS. I am able to register a device with no problem, but am having issues when trying to register a user. Here is my snippet of code:

    <script>
        $(function () {
            Pushwoosh.push(function(api) {
                api.registerDevice();
            });

            $.ajax({
                type: "POST",
                url: "https://cp.pushwoosh.com/json/1.3/registerUser",
                data: JSON.stringify({
                    "request": {
                        "userId": "test", //type: string (ex: email, facebookId)
                        "application": "XXXX" //Pushwoosh application code
                    }
                }),
                dataType: "json"
            }).done(function (data) {
                console.log(data);
            });

        });

    </script>

When I go to the page in my browser, I get the following console message:

{status_code: 200, status_message: "OK", response: "Request format is not valid."}

This is probably something easy but would appreciate any help.

asked 22 Feb, 19:54
KettleOfHawks's gravatar image

KettleOfHawks
111

Hello,

It looks like you are using only a part of our request (user id, app code).

You can find the full request following the link: http://docs.pushwoosh.com/docs/registeruser

Regards, Ivan

permanent link
answered 27 Feb, 08:57
iskoritzky's gravatar image

iskoritzky
2166

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×110
×74
×11

question asked: 22 Feb, 19:54

question was seen: 174 times

last updated: 27 Feb, 08:57