Upcoming API Change: Improvements regarding attachments and user permissions

We would like to make our API consumers aware of upcoming API additions planned for Thursday, January 26th during our weekly deploy.  As these are new sub-resources in our API, they should not affect existing API clients.

Attachments available in entries

If you access Zendesk forum entries via the API, you will now be able to access the attachment resources on entries and posts:

For example:

> curl https://yourdomain.zendesk.com/entries/20000061-testing-image-upload.xml

<?xml version="1.0" encoding="UTF-8"?>
<entry>
  ...

  <attachments type="array">
    <attachment>
      <created-at type="datetime">2012-01-23T09:44:06-08:00</created-at>
      <id type="integer">20000547</id>
      <is-public type="boolean">true</is-public>
      <url>https://yourdomain.zendesk.com/attachments/token/bngjeuenqqkaslq</url>

    </attachment>
  </attachments>
</entry>

 

The same is available on posts:

> curl https://yourdomain.zendesk.com/entries/20000061-testing-image-upload/posts.xml
<?xml version="1.0" encoding="UTF-8"?>
<posts type="array" count="1">
  <post>
    ...
    <attachments type="array">
      <attachment>
        <id type="integer">20000557</id>
        <is-public type="boolean">false</is-public>
        <url>https://yourdomain.zendesk.com/attachments/token/bngjeuenqqkaslq</url>
      </attachment>
    </attachments>
  </post>
</posts>

 

Attachments available in XML exports for forum entries

If you use our XML export to access forum entries, you will now be able to access the attachments in the exported entries.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<entries report_date="20120123">
  <entry>
    <attachments type="array">
      <attachment>
        <id type="integer">20000547</id>
        <is-public type="boolean">true</is-public>
        <url>https://yourdomain.zendesk.com/attachments/token/bngjeuenqqkaslq</url>
      </attachment>
    </attachments>
  </entry>
</entries> 

 

Access to roles and permissions

Our Enterprise customers can now read the permission set on a user record as it relates to a custom role.  For more information about setting roles on users, see our users API documentation.

> curl https://yourdomain.zendesk.com/users/12345.xml
<?xml version="1.0" encoding="UTF-8"?>
<user>
  ...
  <custom_role_id>8847</custom_role_id>
</user> 

Have more questions? Submit a request

Comments

  • Avatar
    David Kakon

    Hi Steve

     

    Im trying to create a USER using the API whenever a CONTACT is created in my SALESFORCE account. I would need at least a PHONE field (at best 2 cell + office).

     

    I dont see this in the API documentation, can you help?

     

    Thanks

    David

  • Avatar
    Steven Yan

    Hi David, to clarify you are trying to create a user and set a phone number on it at the same time?  

    Here's an example:

    curl -u user@domain.com:password https://yourdomain.zendesk.com/users.json -X POST -H "Content-Type:application/json" -d '{"user":{"name":"OH HAI","email":"steven@blah.com","phone":"5555555555"}}'

    {"name":"OH HAI","locale_id":null,"uses_12_hour_clock":false,"openid_url":null,"created_at":"2012/02/27 21:32:59 -0800","last_login":null,"details":null,"updated_at":"2012/02/27 21:32:59 -0800","notes":null,"external_id":null,"restriction_id":4,"id":170658017,"is_verified":false,"custom_role_id":null,"phone":"5555555555","is_active":true,"time_zone":"Eastern Time (US & Canada)","roles":0,"organization_id":null,"photo_url":"https://yourdomain.zendesk.com/images/types/user\_sm.png","email":"steven@blah.com"}

     

  • Avatar
    Van

    Steven, my need is similar -- on an incoming call, I have the Caller ID -- I want to create a user with that caller ID -- or if a user exists with that caller ID already to open that record

    To get started I am happy just to create the record -- trying to follow this example, but I'm getting errors

    curl -k -u agentemail:agentpassword https://company.zendesk.com/users.json -X POST -H "Content-Type:application/json" -d '{"user":{"name":"Unassigned","email":"unassigned@company.com","phone":"15555555555"}}'

    the error I get is that the server cannot parse JSON

    am I making an error in the syntax

  • Avatar
    Steven Yan

    Hi Van, I'm unable to reproduce the JSON parsing error that you are seeing if I replace the password and URL with my own.  Your request looks perfectly fine.  If it's still not working for you, please submit a support ticket with the exact curl request you're making and we can help you out.  

    Also, please note that you should start to adhere to API v2, details can be found here: http://developer.zendesk.com

  • Avatar
    Simon

    I'm missing the attachment url when I get the entries via json. In the XML it is included.

  • Avatar
    Steven Yan

    Hi Simon, are you talking about API v2?  If so, we are putting in a fix for this.

Please sign in to leave a comment.