Skip to content

campbellanderson/node-uservoice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uservoice

A simple node library for uservoice Private Applications

Install

  npm install uservoice

Usage

Request

var UserVoice = require('uservoice');

var uservoiceRequest = new UserVoice(CONSUMER_KEY, CONSUMER_SECRET, ACCOUNT_SUBDOMAIN);
uservoiceRequest.get({
                url:"tickets/search.json",
                data:{
                    query: "from:[email protected]"
                }
            },
            function (err, ticketsResp)
            {
                if (err) {
                    console.log( err );
                    return res.json(400, {error: 'Unable to contact UserVoice'});
                }
                res.json(200, ticketsResp);
                });
            });

Response

{
  "response_data": {
    "query": "from:[email protected]",
    "page": 1,
    "per_page": 10,
    "total_records": 1,
    "filter": "all",
    "sort": "newest"
  },
  "tickets": [
    {
      "id": 881xxx,
      "ticket_number": 2,
      "subject": "I need help with blah",
      "state": "open",
      "url": "https://ACCOUNT_SUBDOMAIN.uservoice.com/admin/tickets/2",
      "custom_fields": [],
      "messages": [
        {
          "id": 154xxxx,
          "channel": "web",
          "body": "Yeah this is just a test",
          "plaintext_body": "Yeah this is just a test",
          "is_admin_response": false,
          "sender": {
            "id": 359xxxx,
            "name": "xxx xxx",
            "email": "[email protected]",
            "title": "Chief something",
            "url": "http://ACCOUNT_SUBDOMAIN.uservoice.com/users/359xxx-xxx-xxx",
            "avatar_url": "https://secure.gravatar.com/avatar/de08d7e1d3f96e8xxxxxx?size=70&default=https://cdn.uservoice.com/images/admin/icons/user_70.png",
            "karma_score": 0,
            "created_at": "2013/05/06 12:03:44 +0000",
            "updated_at": "2013/05/15 13:24:41 +0000"
          },
          "attachments": [],
          "created_at": "2013/05/15 13:38:11 +0000",
          "updated_at": "2013/05/15 13:38:11 +0000"
        }
      ],
      "notes": [],
      "assignee": {
        "id": 359xxx,
        "name": "xxx xxx",
        "email": "[email protected]",
        "title": "Chief something",
        "url": "http://ACCOUNT_SUBDOMAIN.uservoice.com/users/359xxx-xxx-xxx",
        "avatar_url": "https://secure.gravatar.com/avatar/de08d7e1d3f96e8d0799b8xxx?size=70&default=https://cdn.uservoice.com/images/admin/icons/user_70.png",
        "karma_score": 0,
        "created_at": "2013/05/06 12:03:44 +0000",
        "updated_at": "2013/05/15 13:24:41 +0000"
      },
      "created_by": {
        "id": 359xxx,
        "name": "xxx xxx",
        "email": "[email protected]",
        "title": "Chief something",
        "url": "http://ACCOUNT_SUBDOMAIN.uservoice.com/users/359xxx-xxx-xxx",
        "avatar_url": "https://secure.gravatar.com/avatar/de08d7e1d3f96e8d0799b8xxx?size=70&default=https://cdn.uservoice.com/images/admin/icons/user_70.png",
        "karma_score": 0,
        "created_at": "2013/05/06 12:03:44 +0000",
        "updated_at": "2013/05/15 13:24:41 +0000"
      },
      "updated_by": {
        "id": 359xxx,
        "name": "xxx xxx",
        "email": "[email protected]",
        "title": "Chief something",
        "url": "http://ACCOUNT_SUBDOMAIN.uservoice.com/users/359xxx-xxx-xxx",
        "avatar_url": "https://secure.gravatar.com/avatar/de08d7e1d3f96e8d0799b8xxx?size=70&default=https://cdn.uservoice.com/images/admin/icons/user_70.png",
        "karma_score": 0,
        "created_at": "2013/05/06 12:03:44 +0000",
        "updated_at": "2013/05/15 13:24:41 +0000"
      },
      "contact": {
        "id": 359xxx,
        "name": "xxx xxx",
        "email": "[email protected]",
        "title": "Chief something",
        "url": "http://ACCOUNT_SUBDOMAIN.uservoice.com/users/359xxx-xxx-xxx",
        "avatar_url": "https://secure.gravatar.com/avatar/de08d7e1d3f96e8d0799b8xxx?size=70&default=https://cdn.uservoice.com/images/admin/icons/user_70.png",
        "karma_score": 0,
        "created_at": "2013/05/06 12:03:44 +0000",
        "updated_at": "2013/05/15 13:24:41 +0000"
      },
      "last_message_at": "2013/05/15 13:38:11 +0000",
      "created_at": "2013/05/15 13:38:11 +0000",
      "updated_at": "2013/05/15 13:38:11 +0000"
    }
  ]
}

Docs

https://developer.uservoice.com/docs/api/reference

Enjoy! - Campbell Anderson https://github.com/campbellanderson

About

A simple node module for accessing uservoice api from node

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published