Application Programming Interface forums

0 Abonnenten

3 Themen

4803 Gespräche

Area for questions and answers about SuperOffice API's.

push_pin lock

Webhooks not triggering

Hi, we have 4 webhooks but neither one is triggering. With Postman i can check the status of the webhooks and all 4 have the status "Active". What else could we check?  

EC

Eddy Claesen
2
6
21 h, 54 m vor | 10:00 AM
Thema:
Application Programming Interface forums

Letzte Antworten

I made the call but i get a message that I need to use the "Authorization" header to log in, allthough I'm using the SOTicket value for the Authorization key. In the meantime I just received an email from Superoffice Maintenance that they are updating the Service Client. Could this be the cause?

EC

by Eddy Claesen
18 h, 56 m vor | 12:59 PM
push_pin lock

Bulk label substitutions using CRM Script

Hi, I would like to create a CRM script to mass update labels in SuperOffice.  I.E. loop through a labels that contains the work Sale and replace it with Opportunity. Can this be done.  I have found GetLocalizedTexts in the list agent, but I cannot see a way of looping through all labels, and updating the labels that match my search criteria. Many thanks, Trevor  
Trevor Sharp
2
2
16. Feb. 2024 | 05:59 PM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Hi David, Thanks for the update, good to know what we can and can't do.  Label substitutions are great, but it is a nightmare to update something like "Sale" across the whole system, so it would have been great if we could have programatically effictively did a find and replace on all labels containing the work sale. Thanks for your help on this. Trevor
by Trevor Sharp
22 h, 32 m vor | 09:23 AM
push_pin lock

Add extrafields to preview for request in new service

Hi, Is there a way to show extrafields in the request preview in new Service?  Regards Fredrik

FL

Fredrik Larsson
2
1
15. Feb. 2024 | 09:24 AM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Hi Frederik, This is currently not possible. I recommend you suggest your input via Support - they should be able to evaluate and/or create a wish on this matter.  
by Bas Kreijveld
15. Feb. 2024 | 02:51 PM
push_pin lock

Getting tags for ticket in CRMScript

I'm trying to make an "Outbound email or SMS created" trigger that filters tickets based on tags and/or category and replaces the message with a template, but I cannot figure out how to get hold of the tags. I get "outbox.ticketId" in the event, so I figured I could use NSTicket to get hold of the ticket info, but there is no NSTicket.GetTags() method. How can I get around this? is there a better way than using NSTicket?   #setLanguageLevel 4; EventData ed = getEventData(); if (ed.getInputValue("outbox.eventName") == "addMessage") { // Block the original message ed.setBlockExecution(true); ReplyTemplate rt; rt.load(25); // Send an alternative message Email e; e.setValue("to", ed.getInputValue("outbox.to")); e.setValue("cc", ed.getInputValue("outbox.cc")); e.setValue("bcc", ed.getInputValue("outbox.bcc")); e.setValue("subject", ed.getInputValue("outbox.subject")); e.setValue("body", rt.getPlainBody(1)); Integer ticketId = Integer(ed.getInputValue("outbox.ticketId")); NSTicketAgent ticketAgent; NSTicket ticket = ticketAgent.GetTicket(ticketId); log(ticket.GetCategory().toString()); // e.setValue("body", "A new message has been added to your ticket: " + ed.getInputValue("outbox.ticketId") + ". Please log in to the Customer Centre to view it."); e.send(); }  

SG

Snorre Garmann
2
2
15. Feb. 2024 | 08:47 AM
Thema:
Application Programming Interface forums

Letzte Antworten

Thanks! that worked perfectly.  

SG

by Snorre Garmann
15. Feb. 2024 | 11:29 AM
push_pin lock

Issues with getDownloadUrl

Hi, We very often use the function a.getDownloadUrl(....) and its been working great. But, we just implemented one our our solutions for a customer and it does not work as intended. We recive the correct URL. https://online2.superoffice.com/CustXXXXX/CS/scripts/customer.fcgi/getAttachment/1111111-TheKey-0/File.docx But, once we run the link, we just hit the customer portal and the message:  You do not have access to this page. If i generate an internal url (rms.fcgi), it works just fine, but thats not an option in this case. We have noted that SOME older files works, but not new onces. And it doesnt matter if the attachment is uploaded through service GUI, created by base64, and of course, the request/message is external and so forth. This is an old old customer with a previous onsite installation. Exactly the same code works flawless for 10+ other online customers. Any ideas? Regards Pär Pettersson
Pär Pettersson
2
10
6. Okt. 2021 | 12:00 AM
Thema:
Service and CRMScript Discussion

Letzte Antworten

## Conclusion. The error occours if the attachment is connected to eighter a Ticket or a message. For example: Create an attachment, save it to an extra table, but, also add the attachment id to a message, or an extrafield on a ticket. Solution: Simply create 2 attachments  
by Pär Pettersson
15. Feb. 2024 | 09:31 AM
push_pin lock

The new CRMScript Editor - Some feedback

Hi, We noticed this morning that you have launched a new CRMScript "editor". But, we quickly found a few errors that is causing our day to day to become much harder. 1. Indentation does no longer work. Ctrl + A and then Shift + Tab would indent the code, not it just moves everything to the left. 2. Bracket highlights does not always work. Works just fine The else does not. Seems quite hard to recreate when i try to do it "manually", but we have seen this issue in multiple customer enviroments, and, the code works just fine 3. String highlights does not always work. As you see on the log, the debug16 part should be green. Any suggestions?
Pär Pettersson
9
34
6. Dez. 2023 | 01:14 PM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Hi, I have checked around a bit, and there is some good information here: https://codemirror.net/examples/lang-package/ However, the solution does not seem to be easy. I have posted a question to their forum, and we'll take it from there. I agree that it is frustrating with the crappy auto-indentation. We will try to make it better. Sverre
by Sverre Hjelm
7. Feb. 2024 | 07:30 AM
push_pin lock

Upload document using SuperOffice WebApi library

Hi I'm using SuperOffice.WebApi (latest nuget version) in combination with .Net8 and I'm trying to create a new document in SuperOffice Online (SOD) from a byte array. I'm using the CreateDocumentStreamAsync() method available in the DocumentAgent to get a stream I can fill with data and close.  Here is the code I'm trying to use: using var docAgent = new DocumentAgent(_config); var newDocument = await docAgent.CreateDefaultDocumentEntityAsync(); var header = "My new document"; var attachmentExtension = Path.GetExtension(newDocumentEntity.FileName); var attachmentFileNameWithoutExtension = Path.GetFileNameWithoutExtension(newDocumentEntity.FileName); newDocument.Associate = new Associate { AssociateId = 1 }; newDocument.Contact = new Contact { ContactId = 2 }; newDocument.Date = DateTime.Now; newDocument.Completed = ActivityStatus.Completed; newDocument.DocumentTemplate = new DocumentTemplate { DocumentTemplateId = 2 }; newDocument.Header = "My new document"; newDocument.Name = "MyFileName.pdf"; newDocument.Type = AppointmentType.Document; newDocument.VisibleFor = new[] { new VisibleFor { Visibility = Visibility.All } }; // Saving document var savedDocument = await docAgent.SaveDocumentEntityAsync(newDocument); // Creating stream that can be filled with var docStream = await docAgent.CreateDocumentStreamAsync(savedDocument, true); var tmpStream = new MemoryStream(docStream); await tmpStream.WriteAsync(myNewDocumentByteArray); tmpStream.Close();   This code line creats an Not Supported exception with the message: Stream does not support reading: var docStream = await docAgent.CreateDocumentStreamAsync(savedDocument, true);   I have tried to comment out the line specifying the file name (mabe this is not required anymore): // newDocument.Name = "MyFileName.pdf"; This results in a new UnauthorizedAccessException with the message: Access to the path '\\\\soonlinedev.local\\DFS\\SO_ARC01\\SuperOffice\\Custxxxxx-SO_Arc\\2024.1' is denied.   Does anyone know what is the correct way to upload a byte array (or local file) to SuperOffice Online using the SuperOffice WebApi library?   Thank you
Arild Eik
2
2
26. Jan. 2024 | 09:44 AM
Thema:
Online development and web service API's

Letzte Antworten

Thank you David, it worked! The solution was as always obvious when you see it. 😊
by Arild Eik
26. Jan. 2024 | 10:52 AM
push_pin lock

SaleDate being set 1 day before today.

Hello,   We have identified recently, that a script in our system responsible for setting the SaleDate to today's date for sales with a status other than 1(open) is not working as intended. Upon closer inspection, we observed that after correctly setting the sale date, there is an unexpected step where it is subsequently decremented by one day. I've conducted a thorough check to ensure that no other scripts are conflicting or overlapping with the one in question. This script is the sole instance where the SaleDate is manipulated. This issue has only surfaced recently, as it was functioning as intended at least until December. Both our Production and Test Environments are exhibiting the same problematic behavior and both are on the same build  (Build: Release_10.2.11_2023.12.18-02) Here is a stripped-down version of the script we are running, which is producing the same results. Tracing the script, today yields the following date, which should be inserted. #setLanguageLevel 3; EventData ed = getEventData(); String saleStatus = ed.getInputValue("SaleStatus"); String saleDate = ed.getInputValue("SaleEntity.Saledate"); String curDate = getCurrentDate().toString(); DateTime currentDate = curDate.toDateTime(); String currentDateConverted = currentDate.toString(); If (saleStatus != "1"){ ed.setOutputValue("SaleEntity.Saledate", currentDateConverted); } Any help would be greatly appreciated! Thank you!

AB

Andrei Berianu
2
4
18. Jan. 2024 | 02:57 PM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Hello David,   I see that only Norway is active. The script was activated in early December, and testing did not yield this type of behavior. Only recently I've noticed this.

AB

by Andrei Berianu
19. Jan. 2024 | 09:23 AM
push_pin lock

Reply template - best way to show inline images

Hey, The 100 000 dollar question. Whats the best way to try and prevent blocking of images sent from an reply template through the Email class. Most customers accepts that images are blocked by default and its simply a standard on the web.. But, we have one customer that really dont accept this, so, i figure i´ll ask here anyway if anyone have a solution.   We get the same result using uploaded attachment images as well as using a base64. It seems that it might work with using CID, but, not sure how to fix this throu reply templates. Any ideas? Regards Pär I
Pär Pettersson
2
3
10. Jan. 2024 | 09:14 AM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Glad I am able to help YOU out for once... ;) Have a great day!
by Bas Kreijveld
10. Jan. 2024 | 12:41 PM
push_pin lock

Error when trying to create/update tickets in new service (Onsite 10.2.9)

Hello, one of our customers have a problem with the new service in an onsite enviroment, everytime when they try to save a ticket in the new service does the creation fail and they´ll get this error. MicrosoftSQL Server Native Client 11.0SQL ServerThe conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. They can still create new tickets in the old service. We tried the database on our local machine (We tried creating and updating tickets in the new service), and it worked there which was why we first thought it might have to do with user permissions. We also thought this had to do with user permissions since we could get the ticket list but not create or update tíckets so we tried adding a new copy of the database with new user permissions but that had no effect. We have also tried installing a new Sales&Marketing endpoint but that has not worked out aswell. We have verified that the versions are correct in the SM/CS and the database. There is also another issue when you first try to load in the tickets which generates a 403 error. But when you choose a ticket in the list, the ticket information shows up fine. Have anyone else encountered these problems before? Regards Fredrik

FL

Fredrik Larsson
2
1
8. Jan. 2024 | 12:59 PM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Difference between the old service client and the new request functionality is that the new request functionality goes through NetServer for retrieving tickets/saving tickets, the old service client does not. Few questions based on the issue your described: - ServerSetup has been ran correctly and all dictionary steps have been performed? (you can check in the productversion table) - Both NewServiceRequest and NewTimezoneHandling feature toggles are enabled for all netserver installations? - NetServer can communicate with Service correctly? (Things like CRMScript triggers do work in CRM?) - Do you have any date/datetime extra field configured on ticket level that is required? or missing a default value setting? - If you click open the response object of the Axios error, there is propably some more information there - Anything logging in the CRM.Web log folder?    
by David Hollegien
8. Jan. 2024 | 01:12 PM