Web SDK set department programatically.

8 Comments

  • Erica Girges
    Zendesk Developer Advocacy

    Hi Jonathan!

    Apologies for the delay in getting back to you. You could try using this to set:

    zChat.setVisitorDefaultDepartment(id, callback)

    Then use this to get (if needed):

    zChat.getVisitorDefaultDepartment()

    You can get access to the all of the Web SDK Chat methods here.

    Hope this helps!

    Best,

    Erica - Dev Support



    1
  • Jon Emmett

    Bueller? Bueller?

    0
  • Jon Emmett

    Hey Erica,

    Ok figured that part out, I was just sending the wrong thing.. actually not sending if offline.  So a second question.. is it possible to fill the notes of a user programmatically?  I do not see anything in the sdk to do that. 

    image added for clarity.

     

    I want to be able to pass information to my agents, i.e. survey information, client id, etc. 

     

    0
  • Erica Girges
    Zendesk Developer Advocacy
    Hi Jonathan,
     
    Sorry for the delay! With the holiday last week I was out of the office for a bit. So for the user's notes section you could try to use the Create/Update User [endpoint](https://developer.zendesk.com/api-reference/ticketing/users/users/#create-or-update-user) to add notes with a POST request. You can try doing this maybe by building a small app either built in directly with the Zendesk App Framework or built externally to send the requests. For something like this though, it may just be easier to put together a private Zendesk app with our framework for authentication purposes.
     
    Hope this helps!
     
    Best,
     
    Erica - Dev Support 
    0
  • Jon Emmett

    Hey Erica Girges!  Sorry for my delay I was on vacation. lol. I had looked at that before and it's not what I'm after.  I was actually thinking about building a small simple app that would grab that information and pass it to the agent.  You are right, that would probably be faster and easier.  Thank you!

    0
  • Jon Emmett

    Hey Erica Girges I have one last, well hopefully last, question.  When I go to build this I'm getting the following from your SDK:

    src/vendor/web-sdk.js
    Line 8:1: Expected an assignment or function call and instead saw an expression no-unused-expressions
    Line 9:117: 'define' is not defined no-undef
    Line 9:130: 'define' is not defined no-undef
    Line 122:25: Expected an assignment or function call and instead saw an expression no-unused-expressions
    Line 222:9: Expected an assignment or function call and instead saw an expression no-unused-expressions
    Line 911:13: Expected an assignment or function call and instead saw an expression no-unused-expressions
    Line 1130:17: Expected an assignment or function call and instead saw an expression no-unused-expressions
    Line 3489:13: Expected an assignment or function call and instead saw an expression no-unused-expressions

    This is in a react functional component implementation.   Do you have any idea what it's looking for and how to correct it?

     

    0
  • Jon Emmett

    nevermind.. eslint strikes again.. sigh.. 

    0
  • Erica Girges
    Zendesk Developer Advocacy
    Hey Jonathan,
     
    Hope you had a happy holiday! Oh those pesky linter problems. Glad that sorted itself for you! Please don't hesitate to reach out again if anything else comes up.
     
    Best,
     
    Erica - Dev Support
    0

Please sign in to leave a comment.

Powered by Zendesk