I want create ticket in OTRS system from my own web service and for this goal I use OTRS API (OTRS API - merthod "Ticked created"). Work fine, but I want send email to a specific users.
This my current options for request:
$options = [
"Ticket" => [
"Title" => "Title",
"Queue" => "PT",
"State" => "open",
"Type" => 'Unclassified',
"Priority" => "3 normal",
"Owner" => 'admin#gmail.ru',
// I think this options set getter email, but NO
'CustomerUser' => 'specific_user#gmail.com',
],
"Article" => [
"SenderType" => 'agent',
"ArticleType" => "email-external",
"Subject" => "Subject Article",
"Body" => "Body Article",
"ContentType" => "text/plain; charset=utf8",
"From" => 'admin#gmail.ru' // from whom message
]
];
This screen after created ticked
OTRS ticket created
Any idea what I can change in my $options.
If you create a ticket via the API, by default this will NOT trigger sending an email to the customer, not even if you set the article type as 'email-external'.
If you do want this to happen, the best way is to create a new Notification (prior to OTRS 5 this would be an 'Event Based Notification') as described here: http://otrs.github.io/doc/manual/admin/stable/en/html/administration.html#adminarea-ticket-notifications
You can match on the TicketCreate event, the user who created the ticket via the Web Service, and maybe other attributes as well.
Related
How can I verify if a user is logged in on my services with AWS PHP SDK?
I am logging them with :
$result = $this->awsCognitoClient->adminInitiateAuth([
'AuthFlow' => 'ADMIN_NO_SRP_AUTH',
'ClientId' => $this->appClientID,
'UserPoolId' => $this->userPoolID,
'AuthParameters' => [
'USERNAME' => $userName,
'PASSWORD' => $password,
],
]);
That provides a session token. I want to send that token to another of my services and in that other service I want to check if the token is valid or not. How should I proceed?
Is this the best way or is there a better method to authenticate my user?
To solve this issue i created a singleton instance of an AWSAutWrapper and i share the accesstoken with other services.
wondered if someone could help.
I am using the PHP AWS SDK, v3 (just updated to latest), it's working as it should, can send MP3, returns a json file with transcription.
However, I want to use Content Redaction, but no matter what I try I can't see to get it to work, I don't get any errors, my code looks like this:
$transcribe->startTranscriptionJob([
'ContentRedaction' => [
'RedactionType' => 'PII',
'RedactionOutput' => 'redacted'
],
'LanguageCode' => 'lang',
'Media' => [
'MediaFileUri' => 'someurl',
],
'MediaFormat' => 'file',
'OutputBucketName' => 'bucket_name',
'Settings' => [
'ChannelIdentification' => true,
'SplitChannelTranscription' => true,
],
'TranscriptionJobName' => 'output_filename'
]);
I don't get any errors, it just transcribes it without the Content Redaction.
From their docs:
"To enable content redaction using the API, complete the request parameters of the ContentRedaction object in the StartTranscriptionJob operation. See the request syntax for the StartTranscriptionJob action for more information. To see if content redaction has been enabled for a particular transcription job, use GetTranscriptionJob. To see which jobs have content redaction enabled, use ListTranscriptionJobs."
I'm trying to consume the OTRS generic interface. The rest service is created by the import functionallity. I found the files needed for import here Consuming OTRS TicketConnector from .NET apps
My problem is when I try to consume the interface for example with a curl command
curl http://<user>:<password>#<server-ip>:<port>/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/<Ticket-id> -X GET
The result of the command is
{"Error":{"ErrorCode":"TicketGet.AuthFail","ErrorMessage":"TicketGet: Authorization failing!"}}
I tried every user/password combination that makes sense to me. I tried the otrs admin account, agent account, customer account, root account of the server, EVERYTHING! I can't find a information in the docs that states wich account type is needed.
Here are some information that are printed out by the webservice debugger
Communication sequence started
$VAR1 = {
'DOCUMENT_ROOT' => '/srv/www/htdocs',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'HTTP_ACCEPT' => '*/*',
'HTTP_HOST' => '<server-name>',
'HTTP_USER_AGENT' => 'curl/7.39.0',
'MOD_PERL' => 'mod_perl/2.0.4',
'MOD_PERL_API_VERSION' => '2',
'PATH' => '/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin',
'PATH_INFO' => '/Webservice/GenericTicketConnectorREST/Ticket/<ticket-id>',
'PATH_TRANSLATED' => '/srv/www/htdocs/Webservice/GenericTicketConnectorREST/Ticket/<ticket-id>',
'QUERY_STRING' => '',
'REMOTE_ADDR' => '<server-ip>',
'REMOTE_PORT' => '56065',
'REQUEST_METHOD' => 'GET',
'REQUEST_URI' => '/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/<ticket-id>',
'SCRIPT_FILENAME' => '/opt/otrs/bin/cgi-bin/nph-genericinterface.pl',
'SCRIPT_NAME' => '/otrs/nph-genericinterface.pl',
'SERVER_ADDR' => '<server-ip>',
'SERVER_ADMIN' => '<admin-account>',
'SERVER_NAME' => '<server-name>',
'SERVER_PORT' => '80',
'SERVER_PROTOCOL' => 'HTTP/1.1',
'SERVER_SIGNATURE' => '<address>Apache/2.2.12 (Linux/SUSE) Server at <server-name> Port 80</address>
',
'SERVER_SOFTWARE' => 'Apache/2.2.12 (Linux/SUSE)'
};
Deteced operation TicketGet
No data provided
Incoming data before mapping
$VAR1 = {
'RequestMethod' => 'GET',
'TicketID' => '<ticket-id>'
};
TicketGet.AuthFail
TicketGet: Authorization failing!
Outgoing data before mapping
$VAR1 = {
'Error' => {
'ErrorCode' => 'TicketGet.AuthFail',
'ErrorMessage' => 'TicketGet: Authorization failing!'
}
};
Long story short: what type of authentication or user type otrs expects to access the generic interface?
In found my mistake. The way I passed the login credentials to the service was wrong.
In my case the user is a agent user.
Here is a working curl command for my service:
curl http://<server-ip>:<port>/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/<ticket-id>?UserLogin=<username>\&Password=<password> -X GET
I'm using the Graph API to share a player's progress to his Wall; doing it as an external application (i.e, not as one nested inside the Facebook's iframe).
$attachment = array('message' => "I have completed stage $level of the game with a score of $score!",
'description' => "Desc of the game.",
'name' => "Name of game",
'caption' => "caption",
'type' => 'status',
'status_type' => 'app_created_story',
'link' => "http://somehwere.com/somegame");
$result = $facebook->api("/me/feed/",'post', $attachment)) {
The post starts with "Test FB user shared a link via. Application".
How do I change "shared a link" to something else, such as "posted an update from"?
I use Facebook Graph API to post on user's wall. I also attach Flash application ("source" parameter) to it.
$data = array(
'name' => 'Test name',
'message' => 'Custom message',
'picture' => 'http://www.example.com/image.png',
'link' => 'http://www.example.com',
'description' => 'Description of the message',
'source' => 'http://www.example.com/flash.swf',
'access_token' => '... token_here ...',
'method' => 'post'
);
$ret = file_get_contents('https://graph.facebook.com/me/feed?'.http_build_query($data));
The problem that i can't set flash size. For example if use REST API, then you can define attached flash size by "expanded_width" and "expanded_height" parameters.
A few month ago when i tried to publish such post i saw that Facebook set flash size to 398x260, but today when i tried it again, i saw that Facebook set size to 398x224.
1) Does someone know if there is some way to define flash size in Graph API, like in REST API?
2) Is there some official documentation that provide default size of post attachment (source)?