Application Programming Interface forums

0 Abonnenter

3 Emner

4857 Samtaler

Area for questions and answers about SuperOffice API's.

push_pin lock

ListAgent.GetAllLegalBaseAsync fails with InternalServerError

Hi, we are trying to use the SuperOffice.WebApi.Agents.ListAgent to get all legal bases using the following call: new SuperOffice.WebApi.Agents.ListAgent(webApiOptions).GetAllLegalBaseAsync() However, we get an error: SuperOffice.WebApi.Authorization.Exceptions.SuperOfficeWebApiException: InternalServerError Internal Server Error    at SuperOffice.WebApi.Agents.AgentBase.ThrowOnResponseError(HttpRequestMessage request, HttpResponseMessage response) ... The following call for the GetConsentPurposesAsync method using the same webApiOptions works perfectly: new SuperOffice.WebApi.Agents.ListAgent(webApiOptions).GetConsentPurposesAsync() Any ideas?
Dmitry Kuskov
2
3
23. jul. 2024 | 08:01 a.m.
Emne:
Online development and web service API's

Siste svar

I think it's a bug... either in the code generator... or just misconfigured in the model. The methods GetAllConsentSourceAsync and GetAllLegalBaseAsync do not have a backing implementation.
by Tony Yates
25. jul. 2024 | 10:32 a.m.
push_pin lock

Changes i Sale API?

Hi!  Is there any changes implemeted in the API for Sales on 2/7? Dataloads look diffent and the field ' associateDbId' is missing.  We are also receiving 2 files instead of one, please see below.  

SP

Sara Patomella
2
11
8. jul. 2024 | 02:48 p.m.
Emne:
Online development and web service API's

Siste svar

Great. Preparing for and using paging is something we recommend in our best practices. https://docs.superoffice.com/en/developer-portal/best-practices/index.html?#searching, with tips under "Optimizations".
by Tony Yates
16. jul. 2024 | 07:25 a.m.
push_pin lock

NSSource and UserDefinedFields GetDeleted();

Hello Team,   I am trying to set up a script that will prevent our users to close sales that have depracated Sources or in our case, "Sale Department" (Custom Field). After reviewing the documentation, I noticed the Source does not have the GetDeleted() method, and I can't seem to find any information on UserDefinedFields, other than getting them from EventData or mapping them via the Sale Entity. Do you know how I could go about getting the "Deleted" flag for these two? Thank you! #setLanguageLevel 3; EventData ed = getEventData(); /*Source*/ Integer sourceId = ed.getInputValue("SaleEntity.Source.Id").toInteger(); Integer saleId = ed.getInputValue("SaleEntity.SaleId").toInteger(); NSSaleAgent saleAgent; NSSaleEntity saleEntity = saleAgent.GetSaleEntity(saleId); NSSource source = saleEntity.GetSource(); String name = source.GetValue(); /*Sale Dpt*/ //“SaleEntity.CustomFields.SuperOffice:3:DisplayText": "1234 SaleDepartment", //"SaleEntity.CustomFields.SuperOffice:3:DisplayTooltip": "Tolltip", //"SaleEntity.CustomFields.SuperOffice:3:org": "[I:45]" String saleAzetsCompany = ed.getInputValue("SaleEntity.UserDefinedFields.SuperOffice:3");

AB

Andrei Berianu
1
0
15. jul. 2024 | 12:26 p.m.
Emne:
Service and CRMScript Discussion
push_pin lock

Service: When does the yellow bar ("Unknown sender. Click here to add contact") appear?

Hi all, I am struggling with an integration from a different source, where I want to create a ticket via CRMscript. In their example, sometimes the author is known (and then we can link the customer ID / person ID to the request), sometimes the author is unknown. I've been trying to figure out how to get the "Unknown sender" bar active when creating a new request with an unknown author. The bar I am referring to is: So far, I have unable to get this bar activated for a new request with an unknown author. The values which I have filled via script so far are:   String unknownEmailAddress = thisonedoesnotexist@superoffice.com; Ticket t; t.setValue("author", unknownEmailAddress); t.setValue("custId", "0"); And on a (first) message level: Message m; m.setValue("author", unknownEmailAddress); m.addHeader("From", unknownEmailAddress);   These options do not give me the required yellow bar (which allows the users to simply process the incoming e-mail address and/or use the "Reply button" in a normal way).   Does anyone know which element I am missing in CRMscript to get the "Unknown logic" available in this ticket created via script?          
Bas Kreijveld
0
2
11. jul. 2024 | 09:36 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

Yes, this helps, thanks for quick assistance here - making a customer happy with the result :) Note, it should be: t.setValue("fromAddress", unknownEmailAddress); Then it is working as expected!
by Bas Kreijveld
12. jul. 2024 | 07:37 a.m.
push_pin lock

Changing request owner on trigger before save.

Hello.  In the old Servicethere was an out of box functionality that when a user changes the status of a request to closed then she will automatically be set to the owner of the ticket.  Is there a preference for this in the new Service module ?  Even if there is, I would like to be able to manipulate this by using the Trigger before save on Service, but I'm not able to make it work.  These are the input fields related to "OwnedBy" retrieved by the trigger on save button pressed:  "TicketEntity.OwnedBy.AssociateId": "0",   "TicketEntity.OwnedBy.Deleted": "false",   "TicketEntity.OwnedBy.EjUserId": "0",   "TicketEntity.OwnedBy.FormalName": "",   "TicketEntity.OwnedBy.FullName": "(Unassigned)",   "TicketEntity.OwnedBy.GroupIdx": "0",   "TicketEntity.OwnedBy.Name": "",   "TicketEntity.OwnedBy.PersonId": "0",   "TicketEntity.OwnedBy.Rank": "0",   "TicketEntity.OwnedBy.Tooltip": "",   "TicketEntity.OwnedBy.Type": "Unknown",   "TicketEntity.OwnedBy.UserName": "", Ive tried to use ed.setOutputValue("TicketEntity.xx.xx") using everything from ejUserId to name and FormalName but it does not seem to work. Isn't it at all possible to set ticketOwner from request before save trigger ?  Also, I know that i can use the request after save trigger but then i would need to navigate away from the screen or refresh for the correct owner to show in the field.

UT

Ummair Tahir
2
4
10. jul. 2024 | 11:30 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

Hi Ummair, For those items I think simply setting the "ID"-field of the item in the eventdata should do the job. For the owner, we have different relations (ejuser and associate), but for the fields you refer to, there is simply one ID-field.
by Bas Kreijveld
11. jul. 2024 | 11:11 a.m.
push_pin lock

Getting owner's CompanyId using Agent Web API

Hi, We're migrating from the SOAP API to the Agent Web API and need to get the owner's CompanyId (i.e. company ID associated with the license). Previously, we able to do it using the SoPrincipal service and its GetSystemInfo method. Since the SoPrincipal agent for the Web API does not exist, what's the correct way to do it?
Dmitry Kuskov
3
7
9. jul. 2024 | 07:49 a.m.
Emne:
Online development and web service API's

Siste svar

The Dynamic archive provider approach worked like a charm! I was even able to extract the serial number as company.serialNo (I was using the License agent for this before).
by Dmitry Kuskov
11. jul. 2024 | 09:59 a.m.
push_pin lock

List of or documentation of existsting WebAPI

Hi   I am trying to find a list og exixting WebAPIs or a documention of these. I need to mentain the contact interrests ans I can't see anywhere which service to use to that.   If anyone has experience with this part, please let me to know about it.   Kind regards Siavash, Denmark
Siavash Taghizadeh
2
1
10. jul. 2024 | 06:11 a.m.
Emne:
Online development and web service API's

Siste svar

Hi Siavash, you will find the documentation here: https://docs.superoffice.com/en/api/reference/restful/index.html And a library full of example code here: https://github.com/SuperOffice/RESTful-HTTP-Queries/tree/main Specifically for interests: https://github.com/SuperOffice/RESTful-HTTP-Queries/blob/main/src/Interests.http
by Margrethe Romnes
11. jul. 2024 | 08:30 a.m.
push_pin lock

Rename a document in sharepoint to a custom name

Hello everyone, if this is the wrong forum for my question, take my apologies and please guide me to the correct forum... I do want to rename a file (saved to sharepoint) based to the header name with CRMscript. But at least for our tenant, this does not work. The script basically does this:     String myNewHeader = myWantedHeader + docheader;     String myDocumentName = myWantedHeader + docheader + ".docx";     thing.SetHeader(myNewHeader);     thing.SetName(agent.RenameDocument(myDocID, myDocumentName));     agent.SaveDocumentEntity(thing); The Header is set right, but the document does not seem to be renamed in sharepoint. Also i do not get any error message - it just does not work. Am i doing something wrong here? Thanks and kind regards Joerg Hermanns  

JH

Jörg Hermanns
1
0
10. jul. 2024 | 07:38 p.m.
Emne:
Service and CRMScript Discussion
push_pin lock

How to diffrentiate between signature and inline attachment in ticket

Hey folks ! I have made a webpanel in project and sale listing attachments on a ticket using CRMScript. As I havent found a good method in seperating images from signature vs those that are not signature, it will list up all the unneccessary attachments.  Does anyone have a workaround to this ? 

UT

Ummair Tahir
3
5
7. jul. 2024 | 02:31 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

Hi Ummair,   As Michel said, there is no available method to recognize signature images. What you could do is filter the attachment overview based on the size of the file -> for example: do not show attachments smaller than 10 kb (or make a filter to show/hide). Also, sometimes it was useful (in our case) to let the user qualify attachments (and store this qualification in an extratable) > the qualification can then be used to recognize attachments more easily. Good luck finding your best solution! :)
by Bas Kreijveld
9. jul. 2024 | 06:36 a.m.
push_pin lock

New CRMScript editor (again): Monaco

Hi all, We have been testing whether it is possible to replace Codemirror as our CRMScript editor with Monaco (the basis of VSCode). We have currently implemented this as a testable feature in our latest build, hoping that some of you will try it out and tell us what is not working :-) You can enable Monaco as your CRMScript editor by using the "rms.fcgi?action=debug" panel and tick the Monaco-checkbox. The setting is stored as a cookie in your browser and will only affect you in that particular browser, other users will not be affected. This setting is available in build "main_10.3.7_2024.05.23-01". Sverre
Sverre Hjelm
6
15
23. mai 2024 | 08:04 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

Is there a shortcut to get the editor in fullscreen mode ? 

UT

by Ummair Tahir
27. jun. 2024 | 11:09 a.m.