Twin_Engines | 2016-07-21 21:24:35 UTC | #1
Hello, i am trying to test the notification service but i am getting errors when i try to add subscriptions to a channel, i am using this guide to test the API "https://developer.mypurecloud.com/api/rest/v2/notifications/notification_service.html" with Simple Web Socket Client and POSTMAN to do the requests.
Postman works fine as i can for example GET all the channels, i get a Status: 400 Bad Request as response after trying this request:
POST: https://api.{{environment}}/api/v2/notifications/channels/{fagrq0vsf7gna3hlt29qslds6p}/subscriptions
But that line is the same one from the example, the id is correct because i can GET the subscriptions related to that channel.
Any ideas about this?
KevinGlinski | 2016-07-21 21:54:22 UTC | #2
take the { } out of your channel id
/api/v2/notifications/channels/fagrq0vsf7gna3hlt29qslds6p/subscriptions
Twin_Engines | 2016-07-21 22:06:50 UTC | #3
Thanks for the quick answer but i still get the "400 Bad Request" using it with out the { }
KevinGlinski | 2016-07-21 22:13:01 UTC | #4
what does your post body look like?
tim.smith | 2016-07-21 22:15:14 UTC | #5
I'm not sure what you're sending for the body, but the request below works for me. Can you post your request body and the context ID from the response?
POST /api/v2/notifications/channels/jmfdlotlnir87m00kbb50fj5d4/subscriptions HTTP/1.1 Host: api.mypurecloud.com Authorization: bearer xxxx Content-Type: application/json Cache-Control: no-cache Postman-Token: 7868d7b9-005d-147c-7697-924fa64fad7e
[ { "id":"v2.users.9ed7d9f6-0c59-4360-ac54-40dd35eb9c2f.presence" } ]
Twin_Engines | 2016-07-21 22:16:10 UTC | #6
Yeah it was the Post body that had the issue, thanks for the quick answers.
system | 2017-08-28 19:25:27 UTC | #7
This post was migrated from the old Developer Forum.
ref: 158