I'm am trying to create a new Lead in Acumatica via the REST API. The Lead is created but, I can't seem to get the State on the Address to save. It saves all of the other parts of the address: AddressLine1, City, Postal Code, etc. but, not the State. I have tried passing in both the postal abbreviation and the full name of the state. I am doing a PUT to the endpoint to create the Lead. This is in a SalesDemo environment on version 18.107.0022.
TIA!
Here's the JSON object that I'm putting to the endpoint:
{
"Activities":null,
"Address":{
"AddressLine1":{
"value":"123 Anystreet"
},
"AddressLine2":{
"value":""
},
"City":{
"value":"Anytown"
},
"Country":{
"value":"US"
},
"PostalCode":{
"value":"79105"
},
"State":{
"value":"TX"
},
"id":null,
"rowNumber":null,
"note":null,
"Delete":false,
"CustomFields":null,
"ReturnBehavior":0
},
"Attributes":null,
"BusinessAccount":null,
"Campaigns":null,
"CompanyName":null,
"ContactMethod":null,
"DateOfBirth":null,
"DoNotCall":null,
"DoNotEmail":null,
"DoNotFax":null,
"DoNotMail":null,
"Duplicate":null,
"DuplicateFound":null,
"Duplicates":null,
"Email":{
"value":"somebody#mail.com"
},
"Fax":null,
"FaxType":null,
"FirstName":{
"value":"John"
},
"JobTitle":null,
"LanguageOrLocale":null,
"LastIncomingActivity":null,
"LastName":{
"value":"Doe"
},
"LastOutgoingActivity":null,
"LeadClass":null,
"LeadDisplayName":{
"value":"Doe, John"
},
"LeadID":null,
"MarketingLists":null,
"NoMarketing":null,
"NoMassMail":null,
"Owner":null,
"OwnerEmployeeName":null,
"ParentAccount":null,
"Phone1":{
"value":"806-867-5309"
},
"Phone1Type":null,
"Phone2":null,
"Phone2Type":null,
"Phone3":null,
"Phone3Type":null,
"Position":{
"value":"Head of Household"
},
"Reason":null,
"Relations":null,
"Source":null,
"SourceCampaign":null,
"Status":null,
"Title":null,
"WebSite":null,
"Workgroup":null,
"WorkgroupDescription":null,
"id":null,
"rowNumber":null,
"note":null,
"Delete":false,
"CustomFields":null,
"ReturnBehavior":0
}
Can you post your code? My guess is you're not setting the value of the node correctly.
This was being caused by the Branch that I sent in when I authenticated to the web API. The Branch was not valid. I was able to authenticate with no problems. Once I corrected the value that I sent into the service for Branch, the state started working.
Related
I've introduced a new DAC and a new field on the Sales Order associated to the new DAC key. When trying to retrieve the information through OpenAPI it comes back empty. I'd like to know why and how I can adjust my code to return the information. I've tried both PXSelect and PXSelectReadOnly
Declaring Statement on SOOrderEntry(extension):
public PXSelect<IOCSCompanyBrand, Where<IOCSCompanyBrand.companyBrandNbr,
Equal<Current<SOOrderExt.usrCompanyBrand>>>> CompanyBranding;
When I hit the URL: http://localhost/Acumatica21/entity/AcumaticaExtended21R1/20.200.001/SalesOrder?$select=OrderNbr,CompanyBranding,OrderType,CompanyBrand&$expand=CompanyBranding&$filter=OrderNbr%20eq%20'SO-030003'
This is the data that is returned:
[
{
"id": "f827cb43-9b8a-ec11-a481-747827c044c8",
"rowNumber": 1,
"note": {
"value": ""
},
"CompanyBrand": {
"value": "IO"
},
"CompanyBranding": null,
"OrderNbr": {
"value": "SO-030003"
},
"OrderType": {
"value": "SO"
},
"custom": {}
}
]
Acumatica Version: 21.205.0063
Here's the definition for SalesOrder in the endpoint (which was populated via the GUI)
I ended up opening a Acumatica Developer case and here is their response.
Hi Kyle,
Thanks for your time yesterday.
Endpoint mapping is valid but the fields in the view isn't fetch due the limitation of the filter parameter in the request. Filter parameter optimizes the data that are being fetch. In the case, the customer view isn't fetched. To workaround the limitation, instead of using filter, you can try something like below,
http://localhost/Acumatica/entity/AcumaticaExtended21R1/20.200.001/SalesOrder/SO/SO-030007?$expand=CompanyBranding
You can fetch the record and use expand to get the detail level fields. This way you can avoid the limitation of the filter.
Please check and let me know if you have any questions.
Regards,
Vignesh
From the WebHook documentation for a store/customer/address/updated/store/customer/address/created events should have following payload:
{
"scope": "store/customer/address/created",
"store_id": "1025646",
"data": {
"type": "customer",
"id": 60,
"address": {
"customer_id": 32
}
},
"hash": "416ca9c01779515de91824aa1cac9012ee691e7a",
"created_at": 1561481620,
"producer": "stores/{store_hash}"
}
However, in the logs we don't see the "address" part. The payload is always coming as:
{
created_at: 1573847377
data: {
id: 2246136
type: "customer"
}
hash: "%hash%"
producer: "%producer%"
scope: "store/customer/address/updated"
store_id: "%storeid%"
}
And the payload.data.id is not the customer id, as fetching customer by given ID always results in 404.
Fetching address with given id is also impossible, as the resource url should include customer_id which is absent in the response.
Contacted BigCommerce support already, but maybe someone had solved this issue already?
Saw relevant question in the BigCommerce's community, but it was also unanswered.
I have encountered a similar problem, and believe I have isolated the conditions under which it occurs.
I am building an app with MEAN stack that uses bigcommerce API/webhooks.
When I tried to create a customer address in-app, it makes an API request to BigCommerce and creates customer addresses in BigCommerce. Via the webhooks, I have implemented the store_customer_address_created hook event.
So there are two cases when the address webhook event is being triggered:
When the customer address is created in-app and it sends an address creation request via the API to BigCommerce.
When the customer address is directly created in the BigCommerce admin.
Here are the responses from those:
"scope": "store/customer/address/created",
"store_id": "1025646",
"data": {
"type": "customer",
"id": 60,
},
"hash": "416ca9c01779515de91824aa1cac9012ee691e7a",
"created_at": 1561481620,
"producer": "stores/{store_hash}"
}
{
"scope": "store/customer/address/created",
"store_id": "1025646",
"data": {
"type": "customer",
"id": 60,
"address": {
"customer_id": 32
}
},
"hash": "416ca9c01779515de91824aa1cac9012ee691e7a",
"created_at": 1561481620,
"producer": "stores/{store_hash}"
}
As you can see, the address field is not included when the customer address is being created by the API. I’m not sure if it is designed by the BigCommerce team, or a special case. But I think we can identify if the customer address is being created by the BigCommerce admin directly or via the API myself based on this distinction.
I believe you are encountering the first case on your end.
I hope this helps and please update me if you have any other opinions.
It is fairly strange to see this webhook response without the address field, and I haven't had any luck replicating this with scope for store/customer/address/updated. Are you working with any other code beyond this webhook or testing the webhook event specifically?
Here is my issue. I've been trying to transfer a domain to Azure.
I've tried to utilize Microsoft's tool online: https://learn.microsoft.com/en-us/rest/api/appservice/domains/createorupdate#code-try-0
But I keep getting:
The parameter domain.Properties.Consent has an invalid value.
{
"location": "global",
"properties": {
"consent": {
"agreementKeys": ["DNTA","DNPA"],
"agreedBy": "163.xxx.29.xxx",
"agreedAt": "2019-07-30T01:02:38"
},
"contactAdmin": {...},
"contactBilling": {...},
"contactRegistrant": {...},
"contactTech": {...},
"privacy": false,
"autoRenew": true,
"authCode": "201\\S4$04BGK4G9E"
}
}
There is a couple of people working on this and I hope we didn't step on each others toes.
I've done this before and haven't received a message like this before.
Thanks for any ones help.
I always get http 500 error.
Change privacy to true, I got http 200.
I am currently working on extending my existing MS Teams Connector with some potentialActions. In the past I have successfully used the openURI action.
Now I am trying to use the 'Custom Incoming Webhook' to gather some information on the format/amount of information sent to the target, when the user interacts with the card.
EDIT 05/10:
I now switched to using a registered connector (fdfa8471-96a7-411a-a6ad-f402709e2165). The MessageCards are successfully sent to the Teams Chat and show the configured Actions. When trying to use the action, I receive the following error (in the console):
{
"data":{
"errorCode":"Forbidden",
"message":"An unexpected error(Type = Forbidden) occurred. Please try again."
},
"status":403,
"config":{
"method":"POST",
"transformRequest":[
null
],
"transformResponse":[
null
],
"url":"https://teams.microsoft.com/api/mt/emea/beta/users/connectors/19:a5dd279d9bc744cca4286a6a0fadc975#thread.skype;messageid=1557483063258/1557483063258/executeAction",
"data":{
"inputParameters":[
{
"id":"comment",
"value":"pls :)"
}
],
"actionId":"7d66186f-ee1a-4612-a4c7-5c2099758db9",
"potentialAction":"{\"#type\":\"HttpPOST\",\"#id\":\"7d66186f-ee1a-4612-a4c7-5c2099758db9\",\"name\":\"OK\",\"target\":\"https://*******.ngrok.io/api/v1/msteams/connectorAction/comment\",\"headers\":[],\"body\":\"comment={{comment.value}}\",\"bodyContentType\":\"\"}",
"name":"action/connector",
"integrationId":"gcor97uz3c",
"meta":"{\"connectorSenderGuid\":\"fdfa8471-96a7-411a-a6ad-f402709e2165\",\"providerAccountUniqueId\":null,\"connectorConfigurationAlternateId\":\"a092b30d74ee436b9409be217b00e6c2\"}",
"clientInfo":{
"locale":"en-gb",
"country":"gb",
"platform":"Web",
"clientVersion":"1415/1.0.0.2019050223"
}
},
"headers":{
"X-Skypetoken":"pii",
"Authorization":"pii",
"Accept":"application/json, text/plain, */*",
"Content-Type":"application/json;charset=utf-8",
"X-RingOverride":"general",
"x-ms-scenario-id":"1325",
"x-ms-request-id":"d0be16f6c0e745a5c9d3fd9d3c5d09ec_1326",
"x-ms-user-type":"user",
"x-ms-client-type":"web",
"x-ms-client-env":"msteams-web-prod-euwe-01",
"x-ms-client-version":"1415/1.0.0.2019050223",
"x-ms-session-id":"d0be16f6-c0e7-45a5-c9d3-fd9d3c5d09ec"
},
"counter":"ext_actionable_card_http_post",
"decrementNetworkRequests":null,
"hostName":"teams.microsoft.com"
},
"statusText":""
}
The target url set in the action matches the one registered with the connector. In receive no POST to my tunnel, so I assume the error is in the backend.
Can you please point me to some helpful information regarding this issue?
Gelx
I'm using swagger with node.js. I want to use x-ms-dynamic-values to return values to my parameter dynamically.
Basically the first parameter will have a URL then the node.js endpoint will make a get request to that URL and pull back lets say questions, Each URL can have a different amount of questions and the questions can also vary. The get request can get a json response with amount of questions on the page. In my next parameter I want to be able to select a question based on that response.
This is where the x-ms-dynamic-values will come in to play, But I'm nearly 100% sure there are no examples of this being used with node.js only thing I could find was c# example which i will link under this.
So basically my questions is, can anyone provide my with a little example of the node.js I may be able to work from ?
example of the swagger code :
"paths":{
"/api/contacts/{name}":{
"get":{
"tags":[
"DynamicSchemas"
],
"summary":"Get Contact Info",
"description":"Gets contact info of the specified type",
"operationId":"GetContactInfo",
"consumes":[
],
"produces":[
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"parameters":[
{
"name":"name",
"in":"path",
"required":true,
"type":"string",
"x-ms-summary":"Contact Name"
},
{
"name":"contactType",
"in":"query",
"description":"Try either \"Phone\" or \"Email\"",
"required":true,
"type":"string",
"x-ms-summary":"Contact Type"
}
],
"responses":{
"200":{
"description":"OK",
"schema":{
"$ref":"#/definitions/ContactInfo"
}
},
"400":{
"description":"Invalid type specified"
},
"default":{
"description":"OK",
"schema":{
"$ref":"#/definitions/ContactInfo"
}
}
}
Api Example: https://github.com/nihaue/TRex/tree/master/Source