Forums/Community/Zendesk API

Answered

[SOLVED] When will API v2 support X-On-Behalf-Of header (Or pls provide an alternative solution with v1) ?

crapiera
asked this on July 06, 2012 08:39

Hi,

I'm need to create tickets using API v2. I'm using JSON API Version, An admin login and token for authentication and X-On-Behalf-Of header (with a light agent email value). But this cannot be done since using X-On-Behalf-Of with API v2 gets the following HTTP response :

This API version does not support the X-On-Behalf-Of header. Please use an API token

I don't think that this is a token problem cause it works using API v1. I cannot use API v1 since with its JSON version when you create ticket then you get empty result (that is no ticketId is returned even if your ticket is really created......). I cannot use XML version of those API since I don't want to as XML is more heavy than JSON

Note : API v1 provides something called Request instead of Tickets. Then you can use requester_email instead of  X-On-Behalf-Of but API v1 does not return ticketId in JSON version. And it looks like in my tests requester_email is ignored by API v2 when creating ticket

 

Thanks

 

Comments

User photo
crapiera
mobilitys

Solved. Instead of X-On-Behalf-Of I used one of the following depending on the case :

- requester : {name="name", email="email"}

- requester_id:id_value

 

Thus I found no way to submit comment using X-On-Behalf-Of

July 09, 2012 08:32
User photo
crapiera
mobilitys

Comment submit using api with verified light agent as X-On-Behalf-Of (that is authorized to login) are always private

But email response from the same light agent are public.........

July 09, 2012 08:39
User photo
Mike
yabdab

This did not work for. Can you show an example of how you formatted the request?

 

July 13, 2012 13:59
User photo
Ken Lewis

I used the following from the API documentation and it worked like a charm:

  • GET /api/v2/users/{user_id}/tickets/requested.json

As long as you can obtain the "user_id" you're all set.

API documentation I referred to:

July 31, 2012 10:59
User photo
Steven Yan
Product Manager
Check Answer

Hi everyone, sorry for our silence on this.  We've been listening and it looks like X-On-Behalf-Of is the last major gap between API v1 and v2.

We are working on a requests endpoint for /api/v2 which will allow you to create tickets on behalf of an end-user, and the ticket will appear as if it was created by that end-user.  I believe this is the primary use case that you all are looking for.

We hope to have something ready within the next few weeks.  I will update you all here when this is ready.

July 31, 2012 11:02
User photo
Ken Lewis

Oops! I'm referring to my own comment above. I was so focused on "getting" tickets, I missed that the original comment was for "creating" them.

July 31, 2012 11:19
User photo
crapiera
mobilitys

Hi, sorry for silence...(i dislike that too)

To resituate my problems when using api v2 (JSON) are :

- It is not possible to create a ticket as if it was created by an end user. If you set X-On-Behalf-Of as end user email then you'll get HTTP 403.

- It is not possible to comment a ticket as if it was done by an end user. If you set X-On-Behalf-Of as end user email then you'll get HTTP 403.

 

Solution : Create a ticket as if it was created by an end user

This can be done using api v2 by setting requester_id value to end user's id in the JSON request. If end user doesn't exists yet then you can set the following properties (in requester structure) instead of requester_id : name, email. The end user will be automatically created.

 

Solution : Comment a ticket as if it was done by an end user

You should use API v1 and the URI /api/v1/requests/{ticketId}.json to do this. X-On-Behalf-Of should be set to the end user's email and basic authentication credentials should refers to an admin or an agent (not a light agent) e.g Basic adminEmailAddress/token:TOKEN_VALUE_HERE. End user comment will always be public and light agent comment will always be private.

 

Since I use Coldfusion to perfom my tests then I cannot provide examples that may be understood by everyone (Now I have installed curl. Next time I post a question I'll provide example with it)

Thus I'll check news to know when api v2 will support it

August 01, 2012 01:50
User photo
Adrian

I'd love to know when this feature is ready!

August 05, 2012 23:05
User photo
Mountain/\Ash
atmail

Another month - any updates on this?

August 31, 2012 22:56
User photo
Luigi Laezza

Has this been solved?

I am using this format  

"requester":{"requester_id":{"NAME":"Test Karol","EMAIL":"Karol@test.com"}}}

But it is not working .

September 21, 2012 03:49
User photo
crapiera
mobilitys

@Luigi : requester_id value should be an userid value

<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves/> <w:TrackFormatting/> <w:HyphenationZone>21</w:HyphenationZone> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>FR</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:DontVertAlignCellWithSp/> <w:DontBreakConstrainedForcedTables/> <w:DontVertAlignInTxbx/> <w:Word11KerningPairs/> <w:CachedColBalance/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]-->

[SOLVED] When will API v2 support X-On-Behalf-Of header (Or pls provide an alternative solution with v1) ?

<!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true" DefSemiHidden="true" DefQFormat="false" DefPriority="99" LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false" UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tableau Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} </style> <![endif]-->
September 21, 2012 05:03
User photo
Luigi Laezza

@Cedric: I don't have a valid user Id , I am just trying to create a ticket on behalf of the user that is posting the ticket.

check this :

http://de.mysurvey.com/index.cfm?action=Main.lobbygeneral&mycontent=HELP

In your previous post, you have wrote the following :

Solution : Create a ticket as if it was created by an end user

This can be done using api v2 by setting requester_id value to end user's id in the JSON request. If end user doesn't exists yet then you can set the following properties (in requester structure) instead of requester_id : name, email. The end user will be automatically created.

Now this is my case, I don't have an user id. Could you help me understanding how the json should be formatted in order to post a ticket on behalf of an user?

Thanks,

Luigi

September 23, 2012 17:28
User photo
crapiera
mobilitys

@Luigi : In your case if "the user that is posting the ticket" doesn't exists then you should not specify "requester_id". You only specify "name" and "email" (not NAME and EMAIL in uppercase) and Zendesk will create a new user for you :

 

"requester" : { "name" : "FirstName LastName", "email" : "firstname.lastname@domain"}

 

You only specify "requester_id" only if its value corresponds to an existant user (which value can be found by executing a search via webservice).

September 24, 2012 00:10
User photo
Michael L. Parmley
DTA

I am having a similar problem.  My APi creates tickets, but they always end up "via/on behalf of" some random user.  I send

{"ticket":{"fields":{"21021058":"scope-customer","20918707":"10001","20910382":"263289","21024198":"TC","20902371":"1006","21347036":"2013-09-06"},"tags":["client_id-10001","customer_id-263289","endpoint_id-1006","targeted_turnup_date-2013-09-06"],"group_id":"20191032","requester_id":"455681498","submitter_id":"455887778","status":"New","subject":"New Customer Setup - TC","description":"New sales turn up on customer_id 263289 - TC for a 4 call_path Unlimited Lines with endpoint_id 1006 and initial telephone numbers of: 18133950144. Targeted turn up date is 2013-09-06. Please ship 1.00 Grandstream GXW4008 ATA - GXW4008(s) ASAP. Customer has pre-paid for 4.00 Local Number Ports. Customer has pre-paid for 1.00 Toll Free Ports.\r\n\r\nNew Sales Turn-Up:\r\n\r\n Numbers To Port: Yes\r\n Equipment To Order: Yes\r\n Turn-Up Type: Trunking Only\r\n Number Of Extensions: \r\n Type(s) of phones: ","type":"task","priority":"normal"}}"

And I get back

{"ticket":{"url":"https://vollicomm.zendesk.com/api/v2/tickets/4289.json","id":4289,"... Customer Setup - TC","description":"New sales turn up on customer_id 263289 - TC for a 4 call_path Unlimited Lines with endpoint_id 1006 and initial telephone numbers of: 18133950144. Targeted turn up date is 2013-09-06. Please ship 1.00 Grandstream GXW4008 ATA - GXW4008(s) ASAP. Customer has pre-paid for 4.00 Local Number Ports. Customer has pre-paid for 1.00 Toll Free Ports.\r\n\r\nNew Sales Turn-Up:\r\n\r\n Numbers To Port: Yes\r\n Equipment To Order: Yes\r\n Turn-Up Type: Trunking Only\r\n Number Of Extensions: \r\n Type(s) of phones:","priority":"normal","status":"new","recipient":null,"requester_id":455681498,"submitter_id":455887778,"assignee_id":null,"organization_id":null,"group_id":20191032,"collaborator_ids":[],"forum_topic_id":null,"problem_id":null,"has_incidents":false,"due_at":null,"tags":["client_id-10001","customer_id-263289","endpoint_id-1006","scope-customer","targeted_turnup_date-2013-09-06"],"custom_fields":[{"id":21021058,"value":"scope-customer"},{"id":21024198,"value":"TC"},{"id":20910382,"value":"263289"},{"id":20918707,"value":"10001"},{"id":20902371,"value":"1006"},{"id":21342978,"value":null},{"id":21335156,"value":null},{"id":20918727,"value":null},{"id":21347036,"value":"2013-09-06"},{"id":20939003,"value":false},{"id":20940283,"value":false},{"id":20961087,"value":false},{"id":20945541,"value":false},{"id":21374283,"value":false},{"id":20964751,"value":false},{"id":21378716,"value":""},{"id":22211841,"value":null},{"id":20938913,"value":false},{"id":21356923,"value":false},{"id":21373852,"value":null},{"id":21364911,"value":null},{"id":21383427,"value":null},{"id":21364671,"value":""},{"id":21383417,"value":null},{"id":21356933,"value":false},{"id":21378706,"value":null},{"id":20952332,"value":false},{"id":21369572,"value":false},{"id":23036473,"value":false},{"id":21378887,"value":false},{"id":22212317,"value":null}],"satisfaction_rating":null,"sharing_agreement_ids":[],"fields":[{"id":21021058,"value":"scope-customer"},{"id":21024198,"value":"TC"},{"id":20910382,"value":"263289"},{"id":20918707,"value":"10001"},{"id":20902371,"value":"1006"},{"id":21342978,"value":null},{"id":21335156,"value":null},{"id":20918727,"value":null},{"id":21347036,"value":"2013-09-06"},{"id":20939003,"value":false},{"id":20940283,"value":false},{"id":20961087,"value":false},{"id":20945541,"value":false},{"id":21374283,"value":false},{"id":20964751,"value":false},{"id":21378716,"value":""},{"id":22211841,"value":null},{"id":20938913,"value":false},{"id":21356923,"value":false},{"id":21373852,"value":null},{"id":21364911,"value":null},{"id":21383427,"value":null},{"id":21364671,"value":""},{"id":21383417,"value":null},{"id":21356933,"value":false},{"id":21378706,"value":null},{"id":20952332,"value":false},{"id":21369572,"value":false},{"id":23036473,"value":false},{"id":21378887,"value":false},{"id":22212317,"value":null}]},"audit":{"id":16351415756,"ticket_id":4289,"created_at":"2013-08-29T20:43:28Z","author_id":232929412,"via":{"channel":"api","source":{"from":{},"to":{},"rel":null}},"metadata":{"system":{"ip_address":"66.11.10.52","location":"Pittsburgh, PA, United States","latitude":40.41839999999999,"longitude":-80.0509},"custom":{}},"events":[{"id":16351415766,"type":"Comment","author_id":455887778,"body":"New sales turn up on customer_id 263289 - TC for a 4 call_path Unlimited Lines with endpoint_id 1006 and initial telephone numbers of: 18133950144. Targeted turn up date is 2013-09-06. Please ship 1.00 Grandstream GXW4008 ATA - GXW4008(s) ASAP. Customer has pre-paid for 4.00 Local Number Ports. Customer has pre-paid for 1.00 Toll Free Ports.\r\n\r\nNew Sales Turn-Up:\r\n\r\n Numbers To Port: Yes\r\n Equipment To Order: Yes\r\n Turn-Up Type: Trunking Only\r\n Number Of Extensions: \r\n Type(s) of phones:","html_body":"<p>New sales turn up on customer_id 263289 - TC for a 4 call_path Unlimited Lines with endpoint_id 1006 and initial telephone numbers of: 18133950144. Targeted turn up date is 2013-09-06. Please ship 1.00 Grandstream GXW4008 ATA - GXW4008(s) ASAP. Customer has pre-paid for 4.00 Local Number Ports. Customer has pre-paid for 1.00 Toll Free Ports.</p>\n\n<p>New Sales Turn-Up:</p>\n\n<p> Numbers To Port: Yes\n Equipment To Order: Yes\n Turn-Up Type: Trunking Only\n Number Of Extensions: \n Type(s) of phones:</p>","public":true,"trusted":true,"attachments":[]},{"id":16351415776,"type":"Create","value":"New Customer Setup - TC","field_name":"subject"},{"id":16351415786,"type":"Create","value":455681498,"field_name":"requester_id"},{"id":16351415796,"type":"Create","value":20191032,"field_name":"group_id"},{"id":16351415816,"type":"Create","value":["client_id-10001","customer_id-263289","endpoint_id-1006","scope-customer","targeted_turnup_date-2013-09-06"],"field_name":"tags"},{"id":16351415836,"type":"Create","value":"task","field_name":"type"},{"id":16351415856,"type":"Create","value":"normal","field_name":"priority"},{"id":16351415876,"type":"Create","value":"scope-customer","field_name":"21021058"},{"id":16351415886,"type":"Create","value":"10001","field_name":"20918707"},{"id":16351415896,"type":"Create","value":"263289","field_name":"20910382"},{"id":16351415906,"type":"Create","value":"TC","field_name":"21024198"},{"id":16351415916,"type":"Create","value":"1006","field_name":"20902371"},{"id":16351415926,"type":"Create","value":"2013-09-06","field_name":"21347036"},{"id":16351415936,"type":"Notification","via":{"channel":"rule","source":{"to":{},"from":{"id":26930951,"title":"NST01-Ensure portability of all numbers for New Sales"},"rel":"trigger"}},"subject":"Ensure portability of all numbers - {{ticket.title}}","body":"Ensure portability of all numbers for Ticket number {{ticket.id}}. \nCustomer {{ticket.ticket_field_21024198}}-{{ticket.ticket_field_20910382}}\n\nIf there are numbers to port, and they are all portable, check the box labeled \"Portability Ensured,\" and note the numbers porting in the body of the ticket. Create a porting ticket when appropriate.\n\nIf the number(s) are not portable, contact the Requester, {{ticket.requester.name}} and DO NOT check the box. The ticket must be reviewed to determine if the turn up should proceed.\n\nIf there are no numbers to port, simply check the box labeled \"Portability Ensured.\"\n\nhttp://{{ticket.url}}\n{{ticket.comments_formatted}}","recipients":[196245187]}]}}

But the ticket has 6 minutes ago Test Trunk <> via Adam Gerardi (change)

August 29, 2013 13:51