CURL request

English! place to talk about development, programming and coding
Post Reply
ionuts
Znuny newbie
Posts: 2
Joined: 28 Oct 2020, 11:51
Znuny Version: 6.0.27
Real Name: ionut salcianu
Company: home

CURL request

Post by ionuts »

Hi all, I send a curl request from shell to create a tcket:
0. curl "http://my_private_ip/otrs/nph-genericinterface.pl/Webservice/REST/TicketCreate?UserLogin=user&Password=pass" -H "Content-Type: application/json" -d "{\"Ticket\":{\"Title\":\"REST Create IONUT SALCIANUS\", \"Type\": \"Unclassified\", \"UserFirstname\":\"ionut\",\"Queue\":\"Tech\",\"State\":\"open\",\"Priority\":\"3 normal\",\"CustomerUser\":\"ionutionro@gmail.com\"},\"Article\":{\"Subject\":\"IONUT SALCIANU\",\"From\":\"mysytem@mysystem.com\",\"CommunicationChannel\":\"Email\",\"SenderType\":\"agent\",\"IsVisibleForCustomer\":\"1\",\"Body\":\"zone BODY zone \",\"ContentType\":\"text/plain; charset=utf-8\"}}" -X POST
(I created a REST WEB SERVICE from OTRS interface with TicketCreate operation)

1. ticket was created
2, notification was created, but some tags like <OTRS_CUSTOMER_BODY>, or <OTRS_NOTIFICATION_RECIPIENT_UserFirstname> and maybe others are not replaceable, in notification, so I want that body from the ticket created to be visible in body of notification, but appear jus "No body" and other tags missing.

If somebody can help with this, we'll be good, Thanks all ! :)


They show like :
==========================================================
Hi -,

ticket [Ticket#2020102897000362] has been created in queue Tech.


Customer name:ionutionro@gmail.com wrote:
Body: No Body

Created date: 10/28/2020 10:28 (UTC)
============================================================

Template zone:

Hi <OTRS_NOTIFICATION_RECIPIENT_UserFirstname>,

ticket [<OTRS_CONFIG_Ticket::Hook><OTRS_CONFIG_Ticket::HookDivider><OTRS_TICKET_TicketNumber>] has been created in queue <OTRS_TICKET_Queue>.


Customer name:<OTRS_CUSTOMER_REALNAME> wrote:
Body: <OTRS_CUSTOMER_BODY>

Created date: <OTRS_TICKET_Created>


<OTRS_TICKET_Title[30]>
skullz
Znuny superhero
Posts: 617
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: CURL request

Post by skullz »

Your request on article type is agent while the notification is customer body
ionuts
Znuny newbie
Posts: 2
Joined: 28 Oct 2020, 11:51
Znuny Version: 6.0.27
Real Name: ionut salcianu
Company: home

Re: CURL request

Post by ionuts »

skullz wrote: 28 Oct 2020, 21:22 Your request on article type is agent while the notification is customer body
Thank you, so I found that SenderType can take one of the values [agent, system, customer], in my case worked with "customer" value, and the body is visible now! :D
Post Reply