Acumatica run Generic Inquiry via REST API - acumatica

How can I run a generic inquiry that I created via Acumatica's REST API? I was using the Inventory Summary Inquiry before but it was not returning all of the data I needed so we created a Generic Inquiry to return available for shipment quantity for ALL stock items. However I can't find how to get the data from this report via the API.
UPDATE:
I've tried creating an extended endpoint service and adding my endpoint for the report as described in I210 Documentation and then hitting via the REST API (which is not shown in I210). I added all of the result fields to the fields tab of the endpoint that I need returned.
Here are the details I used:
Extended Endpoint Name: MyInventoryAvailable
Endpoint version: 6.00.001
Endpoint: GetAvailableInventory
URL: https://mycompany.acumatica.com/entity/MyInventoryAvailable/6.00.001/GetAvailableInventory?$expand=Results
When I do a PUT request using the above details, this is the response I get:
{
"message": "The request is invalid.",
"modelState": {
"": [
"The request body should not be empty."
]
}
}
UPDATE 2
Here is the setup in Acumatica for the extended endpoint:
I've tried setting up a request body but with no success:
{
"InventoryID": {
"Value": "AB-CL-60"
},
"Description": {
"Value": ""
},
"Location": {
"Value": ""
},
"QtyHardAvailable":{
"Value": 0.0
},
"QtyOnHand":{
"Value": 0.0
},
"Warehouse":{
"Value": 0.0
}
}
When sending any request body, regardless of the content I recieve this error:
"exceptionMessage": "The given key was not present in the dictionary.",
"exceptionType": "System.Collections.Generic.KeyNotFoundException",
UPDATE 3 - Inquiry Structure
Here is the structure of the inquiry:
And here are the results in Acumatica's UI:
UPDATE 4
Expanded GetAvailableInventory node:

This is how I structure Generic-Inquiries in Web-Service-Endpoints.
While other Endpoints contain any number of Mapped Objects, the Generic-Enquiry Endpoints only have
Enter-Keys, Filter, Result, and Values-for-Update
The FIELDS for the ENDPOINT are the Filters (click POPULATE -> Filters). The example above does not seem to have any filters, which is fine, so this FIELDS should be empty.
To get the data from the Generic Inquiry, a "Detail" entity is added
click the Generic Inquiry
click "+ INSERT"
Fill in form with FieldName='GetAvailableInventoryResults', ObjectName='GetAvailableInventoryResults', ObjectType=Detail
Save
Now, add the results wanted by clicking on 'GetAvailableInventoryResults', then FIELDS (opens a popup). In the popup, select 'Result' and add all the fields you want. Don't select "Row Number" and "Selected" as these are not needed and can cause errors. SAVE.
To access the ENDPOINT, do a PUT to
.../GetAvailableInventory?$expand=GetAvailableInventoryResults
with a BODY of
{}
since this ENDPOINT does not define any Filters, but a PUT requires this to exist.
Why do I use "GetAvailableInventoryResults"? Well, because I ran into issues with multiple Generic-Inquiry Endpoint's having Details with the same name, so I make sure they are all unique.

Use GET instead of PUT. Your requirements fall under this. I supposed Generic Inquiry <> Inquiry Form. Hence the different outcome between GET vs PUT.

Related

Shopware advanced pricing - update rule prices via API

so I got this issue that I have some rules set up for customer groups (each per different sales channel). I then used those rules in advanced pricing tab for some of my products. Now I would like to change the advanced product price for a single rule using API request. From what I understand, it should be possible using 'product-price' endpoint, PATCH method (https://shopware.stoplight.io/docs/admin-api/8fe455ace068a-list-with-basic-information-of-product-price-resources).
I am making a request with payload like below and url https://shop-domain/api/product-price/fda10622ed67472e82d800618b0c36d1:
advanced pricing img
amazon rule img
postman request img -204 No Content
product-price endpoint img
{
"data":
{
"type": "product_price",
"id": "fda10622ed67472e82d800618b0c36d1",
"attributes": {
"productId": "675b627cb3034444af9904bb41901a32",
"ruleId": "ace571bd8e6f48c88f17a551ed1e2654",
"price": [
{
"currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
"net": 115.44,
"gross": 234.50,
"linked": false
}
],
"quantityStart": 1
}
}
}
... but I am getting no effect and no actual response (response is empty, 204 - No Content). What am I missing? The ultimate goal here for me is to be able to set up different prices for different sales channels like Amazon or eBay for given products. Also, the request I present here is for single update, though it would be better if this could be a bulk request (I've tried /api/_action/sync upserts as well, but I'm not sure how it should be done - documentation here seems to be quite laconic).
The "id" that I'm using here is product price id that I got using GET method on the same endpoint - for listing all product prices from advanced pricing (last image; /api/product-price: https://swagger.docs.fos.gg/).
What am I missing here, how it should be done properly? Should I use customer groups for rules or maybe Sales Channels (if it even makes any difference here)?

JSON request for envelope with single document, two signers, pre-fill fields

I have an envelope with a single document and two signers saved as a server-side template. The signers execute the agreement in a specific order. The document has a number of pre-fill fields in it.
I am trying to automate sending this agreement out using Integromat. Unfortunately, Integromat's module doesn't allow for pre-fill fields in templates, leaving me to create the API request manually. This is where I get stuck.
The closest I have come is the JSON request below, POSTed to:
…/v2.1/accounts/{accountId}/envelopes, with capitalised values filled in automatically:
{
"templateId": "TEMPLATE_ID",
"templateRoles": [
{
"email": "CLIENT_EMAIL",
"name": "CLIENT_NAME",
"roleName": "Recipient",
"tabs": {
"prefillTabs": {
"textTabs": [{
"tabLabel": "Prefill: Purpose",
"value": "PURPOSE_FIELD_DATA"
}]
}
}
}, {
"email": "STAFF_EMAIL",
"name": "STAFF_NAME",
"roleName": "Company"
}
],
"status": "sent"
}
The response from the API is:
The operation failed with an error. [400] A Required field is
incomplete. TabId: GUI_HERE
What I can't figure out is how to get the pre-fill data submitted since it's not tied to a particular signer. I have scoured the v2.1 API documentation but there is no scenario simple enough for this request.
Apologies if I am missing something obvious here; this is my first rodeo with DocuSign's API.
Do you have any idea what I am doing wrong or, better yet, what the body of the request should be for this (presumably) simple scenario?
Update: For pre-fill tabs, you need to have both the tabId and tabLabel, not enough to just have tabLabel like regular tabs.
My guess is a mismatch of the tabId field for the tabs on your template vs. what's in the API request:
You had this value in your request:
Prefill: Purpose
Does it match how the template was set?
I just tried this with composite templates.
When I added the prefill tabs to a recipient I received the error
Error code: INVALID_TAB_OPERATION.
Message: The Tab specified is not valid for the requested operation.
PrefillTab not allowed for recipient.
which makes sense since prefill tabs are associated with a document, not a recipient.
I tried by adding a document to the composite template, but that didn't work either.
I suggest that you use regular tabs. Mark them locked so they can't be changed. Mark them shared so every signer will see them. Then fill in their values as part of your Envelopes:create call.
Here's a live example of doing this. Note the text2 tab which is locked. (It should have the shared attribute set to true. You can add that from the Tabs/text toolbox on the left.)
Also see this blog post about templates.
Integromat does even without using DocuSign Rest APIs.
You can use Powerforms, it will save your cost for Rest APIs.
I recently did this, but issue is for first recipient, you need to send email manually with powerform link.
Here I dynamically construct PowerForm URL where I pass values to pre populate template fields.
To send email from integromat, you can configure Gmail module or any other email module and create html template where you can append Powerform URL in anchor tag

How to find API end point for Release Notes field while creating bug via REST API for Azure DevOps Services

I am trying to add a bug via REST API, but I can't find path for release notes field.
I checked official documentation for field list, but there are no info regarding release notes field
official documentation link
Following could should create opertion to insert info into release notes, but the Path is wrong
patchDocument.Add(
new JsonPatchOperation()
{
Operation = Operation.Add,
Path = "/fields/Microsoft.VSTS.Common.ReleaseNotes",
Value = "1"
}
);
Is there any unofficial documentation, or some library where I can see list of all available API endpoints for fields?
Short answer - yes! - the link that you have in the question is that API. However, that doc is the API reference for Get Work Item Types operation which contains just an example modelling the sample response one might get, and not the holistic list.
Before I begin, I'm assuming that Release Notes is a Custom-defined field here, as I don't see it in the default Work item field index.
To know what path for this (custom) field might look like, it'd help to execute the Get Work Item Types API for type bug within the scope of your project, and look at the response. This is what I got, for example:
where "dependsOn" is the custom field that I defined in the process used by my Project.
So for creating a bug, I provided the request body in the following format to the Create Work Item API:
[
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "Sample Bug"
},
{
"op": "add",
"path": "/fields/Custom.dependsOn",
"value": "Auth"
}
]
and voila, had a bug created. Hope this helps!

Adding a Notes using WEB API

I have gone through the WEB Api for leads and not able to find a proper field to update Notes for Leads.
I have used SOAP for creating sales order where NoteText is exposed to update the notes and what is the relevant field in WEB
You need to use the note property.
The value for this property must be specified directly (without nested object with value property).
Below is an example of the body of the PUT request:
{
"LeadID": {
"value": 11973
},
"note": "Some very interesting note\nSome other text from new line."
}

Acumatica REST endpoint for entity USERS is not updating when using PUT

I extended the defaults web-services endpoint and added SM201010 USERS as an entity with needed fields.
I am able to do a GET and users data is returned perfectly, but when I try to do a PUT to update fields like 'Comment' its returning status code 200 OK success but its not updating the fields.
This is the PUT body example where i tried updating the comment field for the user 'admin':
{
"Login": {"value": "admin"},
"Comment": {"value": "this is a comment update"}
}
Any idea what I am doing wrong?

Resources