Hi,

I created an app in my pushwoosh account. I am able to get the notifications using the default tags in conditions(for example Country).

I created a custom tag named alias(string). I did setTags for my device. The response was {"status_code":200,"status_message":"OK","response":{"skipped":[]}}

When I used the createMessage method with alias tag, the response was {"status_code":200,"status_message":"OK","response":{"Messages":["DB7A-1357270A-94B50A8C"]}} but I did not get the notification on my device.

When I tried calling getTags for the same device (using the same hwid as in set tags) I am getting this response {"status_code":210,"status_message":"Device not found","response":null}

Following is the structure of my code (for set tags):-

    def pw_call(method, data):
    url = 'https://cp.pushwoosh.com/json/1.3/' + method
    data = json.dumps({'request': data})
    req = Request(url, data.encode('UTF-8'),
                  {'Content-Type': 'application/json'})
    try:
        f = urlopen(req)
        response = f.read()
        f.close()
        print('Pushwoosh response: ' + str(response))
    except Exception as e:
        print ('Request error: ' + str(e))


if __name__ == '__main__':
    pw_call('setTags', {
        'application': PW_APPLICATION_CODE,
        'hwid': 'IMEI number of my device',
        'tags': {
            'alias': 'robs',
            }
    }
    )

Following is the structure of my code (for get tags):-

    def pw_call(method, data):
    url = 'https://cp.pushwoosh.com/json/1.3/' + method
    data = json.dumps({'request': data})
    req = Request(url, data.encode('UTF-8'),
                  {'Content-Type': 'application/json'})
    try:
        f = urlopen(req)
        response = f.read()
        f.close()
        print('Pushwoosh response: ' + str(response))
    except Exception as e:
        print ('Request error: ' + str(e))


if __name__ == '__main__':
    pw_call('getTags', {
        'application': PW_APPLICATION_CODE,
        #'auth': PW_AUTH,
        'hwid': 'IMEI number of my device'
    }
    )

Where PW_APPLICATION_CODE is my app code (B5C6C-E8AC0).

asked 08 Nov '16, 11:30
Prateek%20Sharma's gravatar image

Prateek Sharma
111

Hello,

I have already answered to your request you have sent to Pushwoosh support. However, let me post the answer here.

Please note, that "Device not found" error indicates that there is no such device subscribed to pushes on specified application. Also, the HWID is not equal to the IMEI number. You can get the actual HWID of the device in the console log in the /registerDevice request.

permanent link
answered 10 Nov '16, 06:35
Oleg%20Zhukov's gravatar image

Oleg Zhukov
2174

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:

×52
×10
×4

question asked: 08 Nov '16, 11:30

question was seen: 613 times

last updated: 10 Nov '16, 06:35