how to upload a photo in acumatica using put - acumatica

I just want to ask if it is possible to upload or attach a file in a contact using rest API I can currently put a new contact in Acumatica using put. My question now is can I also attach a link for its file like url/cloudstorage/image.jpg. I want to put it on file and be an image for the new contact

You need to make a separate PUT call to upload the image and append entity key/files/image_filename to the URL:
http://localhost/AcumaticaDB/entity/Default/18.200.001/StockItem/AALEGO500/files/Sample.jpg
With REST API you can currently only upload files to master entity (form/header).
If you need to attach files to detail entities you need to create a custom maintenance screen for the detail entity and extend the webservice endpoint to add that custom screen. Essentially it creates a master screen for the detail.
Reference:
https://help-2020r1.acumatica.com/Help?ScreenId=ShowWiki&pageid=591def3d-5fe5-42c1-bb35-cfe5b4c77f6f

Related

Word Templates not showing up in SharePoint/Teams after being added via PowerAutomate

I've been trying to setup a flow that automatically mirrors (read: copies and creates new) Word templates from one Teams Channel to another.
The goal is to have them appear in the "+ new"-dropdown in sharepoint and teams (see screenshot).
"+new"-dropdown in Teams
I believe I managed to find the path to the folder in which to put the template-file, which is: https://yourcompany.sharepoint.com/sites/YourSiteName/Freigegebene Dokumente/Forms
The "Freigegebene Dokumente" should be "shared documents" in english afaik.
Here comes the caveat:
When I upload a template-file via powerautomate, they do not show up in the "+ new"-dropdown. When I then try to manually add the same file via the "+ new"-dropdown, it tells me that a file with that name already exists.
Am I missing something? I fully expected this to just work.
What I am trying to get running so that the bigger solution can work is this:
Manually trigger a Microsoft PowerAutomate Cloudflow
Get information about a specific file in SharePoint (a .dotx MS-Word template)
Get the content of that specific file
Create a new File in the */Forms folder with the same name and content as seen in the screenshot.
Be able to create a new File in SharePoint (and Teams) from that template via the "+new"-dropdown
The two parameters used are:
#outputs('Dateieigenschaften_abrufen')?['body/{FilenameWithExtension}']
and
#body('Dateiinhalt_abrufen')
Screenshot of the flow
After running this flow, I expect to have a new template to choose from in the "+new"-dropdown in SharePoint. That is not the case.
I know that there is something uploaded, because if I try to manually add the template via the "+new"-dropdown
manual upload in "+new"-dropdown
I get this error message:
Error Message on manual upload

How to serve an ics file through NodeJS API in a way that user can subscribe using URL?

So I have my ics file in Google Cloud Storage and I would like to serve it through my API so I don't have to make the ics file public. However, I am not sure what is the right way to do that so that the user can put the link to my api call in their Google Calendar as a webcal link to subscribe to the calendar.
Is this possible or do I have to provide a direct link to the ICS file for the user to be able to subscribe to the calendar? If it is possible, how would I go about serving the file in NodeJS?
Example:
https://storage.googleapis.com/example/calendar.ics would be able to be served through https://api.com/example/userID/calendars
webcal://api.com/example/userID/calendars would then be used in the Google Calendars to subscribe to the calendar
So I had two options available to me:
Change the access to the ICS file to public then share that URL to the user. However, this method would not allow me to dynamically change the file in the case that I would want to delete or change the file name.
Serve the ICS file through my API - the method I had originally asked about in the original post.
So for method 2, I basically just had to do gcs.bucket('bucket_name').file('file path to ics file in bucket').download((error, content) => res.send(content))

Create PDF file with pre-defined template

I am trying to create a PDF with the pre-defined template with this particular library called PDFKIT. The server is written in Nodejs, may I know is there any good example I could refer to? What I want to achieve is to have a User Interface as an entry form, and then there is a pre-defined PDF file in-place on the server.When the user hits the submit button, the pdf rendering engine will pick-up the data and embedded into the pdf template file.
Take a look at the PSPDFKit for Web / PSPDFKit Server API docs for handling forms which let you retrieve and update all form fields. You can then use the document APIs for downloading a PDF with the form fields set to whatever values your user submitted.
So to recap, the steps are:
Upload the template PDF to the server storing the document id in your database or in the user's session.
Fill in the form fields using the data your user submitted.
Download the PDF with the updated form fields and e.g. email it or store it somewhere.
Alternatively you can create a signed URL so that you can directly redirect your user to the generated PDF.
Have you heard about PhantomJS? There is a package which name is phantom-html-to-pdf. You may give it a try.

Is it possible to group or put multiple images inside a folder using xpages, like in FB photo albums?

we have a client that wants to have an FB like photo album feature, where in the user can upload image(s) and put those uploaded or selected image(s) inside an album. I just want to know first if it's possible using out of the box xpage or I need to use a framework. Thank you in advance.
Both ways are possible, it depends on your requirements.
Take a look at this OpenNTF project - Bildr: http://www.openntf.org/main.nsf/project.xsp?r=project/bildr

Retrieving files from blog media entries

The tool I'm building needs pull data from IBM Connections Ideation Blogs. I therefore use the Connections API with basic authentication to read Blog Entries. This goes well until the description contains images. When I ask the API to provide media resources for the blog, it does not show any entries of the /BLOGS_UPLOADED_IMAGES location - the one containing images uploaded through the blog's richtext editor. The user I use in my API call is the same user who created blog entries and uploaded pictures.
However the API call DOES contain images I publish using the API and a POST request to the blog's media entry collection. This is where the next problem appears. Those Atom entries for images contain various links, one of them with a ref="enclosure", of which the API documentation (link) tells me to "Use the web address in the href attribute to obtain the binary content of the file". However, my calls to this adress are always answered with 404 response code.
Another url in the Atom entry (this time of the element) is described by the same documentation (see link above) as: "Provides access the document's media. The following operation is supported: GET: Use the web address to obtain the media." When I make a call to this url, as always with basic authentication credentials attached, the response contains the html of the login form of Connections, so API authentication does not seem to be supported on this url. This is only the case for non-public communities, which require authentication, of course, if the picture is publicly availabe all works just fine.
Am I missing something out? Is there another way to retrieve the actual image from a blog's media entry through the API? Are manually uploaded pictures never contained in the media entries result or is this a bug?
It now magically works using the link with ref="enclosure" from the atom entry. I might have gotten something wrong with authentication I guess (although I'm not actually realizing what I'm doing different now than I did before).
Problem remaining: Pictures uploaded through the rich-text editor in the folder /BLOGS_UPLOADED_IMAGES do not appear in the media feed of the blog.

Resources