Sage 300 (accpac) SDATA Create Customer - erp

I'm trying to use SDATA to create a customer but can't seem to find the proper endpoint. I've scoured the schema and have only found wkshpcustomer, but nobody seems to know what that object is.
I can, however, create an order without issue:
[POST] http://{domain}/SDataServlet/sdata/sageERP/accpac/{company}/oeorders/
<sdata:payload>
<oeorder xmlns="schemas.sage.com/sageERP">
<TERMS>CASH</TERMS>
<CUSTOMER></CUSTOMER>
</oeorder>
</sdata:payload>
When I do the same based on the following blog post (https://smist08.wordpress.com/2011/08/06/fun-with-sdata/) for creating a customer, I get the following:
<?xml version="1.0" encoding="UTF-8"?>
<sdata:diagnoses xmlns:sdata="schemas.sage.com/.../1">
<sdata:diagnosis>
<sdata:severity>error</sdata:severity>
<sdata:sdataCode>ResourceKindNotFound</sdata:sdataCode>
<sdata:message>Resource kind: CUSTOMER cannot be found in the classMap.</sdata:message>
</sdata:diagnosis>
</sdata:diagnoses>
So, how do I create a customer using SDATA?

Related

Is there still "no API to manage consumer googlegroups.com groups programatically"?

In an answer to this 2014 post
Unable to retrieve members of a google group, getting Invalid Input
you read: "There is no API to manage consumer googlegroups.com groups programatically".
Is this still the situation in 2018?
I tried to follow the suggestion in answer 3 of the post How to get the list of members in a Google group in Google app script (Admin SDK)? but I get the following error message:
ReferenceError: "AdminDirectory" is not defined. (line 9, file "Code")
where line 9 (and following) is (are):
page = AdminDirectory.Members.list(groupKey,
{
domainName: 'googlegroups.#com',
maxResults: 500,
pageToken: pageToken,
});
Searching to understand the error I found the reference page for Members: list. Using the "Try this API" form in that page I get the error reported in the first post I mentioned.
If it is NOT true that "There is no API to manage consumer googlegroups.com groups programatically", is there a guide to copy the list of the members of a group I own in a google-sheet sheet? (I mean to copy via a function, non by hand exporting and reimporting the CSV)
Many thanks, Roberto Scotti
It's 2021 and I still can't find any evidence there's an API for #googlegroups.com groups, sadly.

Error using ActiveMerchant::Billing::AuthorizeNetCimGateway with Authorize.Net's opaqueData

Feb 8, 2018
My Ruby on Rails application has been successfully using ActiveMerchant::Billing::AuthorizeNetCimGateway with the payment type :credit_card for creating a customer profile with an embedded payment profile.
I'm now in the process of migrating to Authorize.Net's Accept.js which accepts credit card info directly sent from their hosted payment form and returns a payment nounce of type COMMON.ACCEPT.INAPP.PAYMENT that can be used for one time to create a payment transaction, customer profile, etc.
I constructed a payment_profile hash with :opaque_data in place of :credit_card. For example:
> payment_profile
=> {:payment=>
{:opaque_data=>
{:data_descriptor=>"COMMON.ACCEPT.INAPP.PAYMENT",
:data_value=> "eyJjb2RlIjoiNTBfMl8wNjAwMDUzNjBDMzAwOUQ3OEUzOUQ1MDk4QTYxMjFGNzlCQ0Y3RDRGQUE4NTNCMEU3MkYyMUJBNTI3NUE0NjQ2Q0ZFQTVFNzMxMDI2Qjg5ODJGNjBFRUE2RDZFMTZCMUY5NzQ4NUJFIiwidG9rZW4iOiI5NTE4MDc3Njg5NDA4MTAwOTAzNTAyIiwidiI6IjEuMSJ9"}},
:bill_to=>{:first_name=>"Firstname", :last_name=>"Lastname", :address=>nil, :city=>nil, :state=>nil, :zip=>nil, :country=>nil, :phone_number=>"(012) 234-5678"}}
I then tried to create a customer profile with an existing code similar to the following:
response = #gateway.create_customer_profile profile: {
email: client.email,
description: client.name,
merchant_customer_id: client.id,
payment_profiles: payment_profile
}
However, I received a response which had a result_code of Error and complained about "incomplete content" for element payment as follows:
> response
=> #<ActiveMerchant::Billing::Response:0x007f9827d14900
#authorization=nil,
#avs_result={"code"=>nil, "message"=>nil, "street_match"=>nil, "postal_match"=>nil},
#cvv_result={"code"=>nil, "message"=>nil},
#emv_authorization=nil,
#error_code="E00003",
#fraud_review=nil,
#message=
"The element 'payment' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'creditCard, bankAccount, trackData, encryptedTrackData, payPal, opaqueData, emv' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.",
#params=
{"messages"=>
{"result_code"=>"Error",
"message"=>
{"code"=>"E00003",
"text"=>
"The element 'payment' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'creditCard, bankAccount, trackData, encryptedTrackData, payPal, opaqueData, emv' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'."}}},
#success=false,
#test=true>
I have a few questions in my mind:
Does ActiveMerchant::Billing::AuthorizeNetCimGateway even support Accept.js' :opaque_data in place of :credit_card?
If ActiveMerchant::Billing::AuthorizeNetCimGateway does support :opaque_data, what's may be wrong with the above payment_profile and what other content that I'd need to provide for payment element?
I'd appreciate any help in resolving this issue.
While this question is over 4 years old, and I'm assuming you have either found a solution or abandoned your effort, I ran into this same issue recently, and thought it would be helpful to add my findings in case someone else runs into this.
the AuthorizeNetCimGateway does not currently support Accept.js' opaqueData. In looking at the sourcecode for the active_merchant gem, specifically in /lib/active_merchant/billing/gateways/authorize_net_cim.rb, there is ultimately a method add_payment_profile that gets called. In that method, specifically on lines 759-761, you can see that the options are either a credit_card, bank_account, or drivers_license. A tokenized payment is not currently supported.
That being said, there is an open PR#2422 that adds support for this. At the time of writing this, it appears to be failing some rubocop specs, but hopefully it can get deployed in the near future!

How to create JIRA issue ticket from a template using REST api?

I want to create JIRA Change Request Ticket using a template.
I use JIRA API endpoint '/rest/api/2/issue'.
Below is the format of the data sent to JIRA.
Could anyone please help?
payload =
{ fields:
{ project: { key: "CRQ"},
customfield_15630: "SampleTemplateName",
summary: "Testing",
customfield_17679: "N.A" ,
customfield_14530:"2018-06-17T00:00:00.0+0000 ",
customfield_14531: "2018-06-17T00:00:00.0+0000 " } }
Here is the XML format of template I want to use in the issue ticket.
<item>
<title>[TMPL-167] NTW-8 [Network_Interface_configuration]</title>
<link>https://jiraqa.com/browse/TMPL-167</link>
<project id="15980" key="TMPL">Templates</project>
<description>Test</description>
<environment />
<key id="492895">TMPL-167</key>
<summary>NTW-8 [Network_Interface_configuration]</summary>
</item>
You are definitely lacking an issue type there. Here is an example of a proper issue creation using the REST API: https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-createIssue
Certain fields may be required or not depending on the project settings, but the project ID, the summary and the issue type are an absolute minimum.
Another thing is that you want to use a template in addition to this. Jira may simply not be able to automatically fetch the data from there, but if anything went wrong, you'd receive an error message anyway.
Could you describe in more detail what exactly do you need to do? It would be easier to come up with a solution ;)

How do I fetch orgusers beyond the 1st 100 using the Google Apps OrgUser provisioning API feed

I am using Zend's gdata library for the Google Apps provisioning API. Since Zend doesn't yet support fetching org users (no retrieve function provided by the library for this feed), I am making a custom gdata query to the url (as suggested in the documentation developers.google.com/google-apps/provisioning/#retrieving_organization_users_experimental):
apps-apis.google.com/a/feeds/orguser/2.0/'.$customerId.'?get=all
This works well for <= 100 users.
Now, I have created a domain with 125 users across 5 OUs. When I fetch the above URI, I get the 1st 100 users (as documented and expected). However, I could not find the pagination link mentioned here: developers.google.com/google-apps/provisioning/reference#Results_Pagination
Here's the start of my orguser feed:
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:apps='http://schemas.google.com/apps/2006'><id>https://apps-apis.google.com/a/feeds/orguser/2.0/C00xxxxxxx</id><updated>2013-01-06T08:17:43.520Z</updated><**link rel='next' type='application/atom+xml' href='https://apps-apis.google.com/a/feeds/orguser/2.0/C00xxxxxxx?get=all&startKey=RASS03jtnz0s2orxmbn.**'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://apps-apis.google.com/a/feeds/orguser/2.0/C00xxxxx'/>
I tried the https://apps-apis.google.com/a/feeds/orguser/2.0/C00xxxxxxx?get=all&startKey=RASS03jtnz0s2orxmbn. link but it gives me the exact same 100 users that the https://apps-apis.google.com/a/feeds/orguser/2.0/C00xxxxxxx?get=all link gives. This is the only occurrence of the word "next" in my feed and so there is not other URI I can try to fetch the next 25 users.
So I have only been able to get 100 users from this API call. How do I go about fetching the next 25 users? Examples/code would be really appreciated. Or what am I doing wrong?
Please help - this is blocking an urgent delivery.
Thanks!,
Vinay.
Your 2nd request should look like:
https://apps-apis.google.com/a/feeds/orguser/2.0/C00xxxxxx?startKey=RASS03jtnz0s2orxmbn&get=all
startKey should be set to the value of the next parameter and get should continue to be all for each page request.
Also, make sure the URL is decoded, if & is encoded as & in the request, then Google's servers will see all of all&startKey=RASS03jtnz0s2orxmbn as the value of get and it won't see a startKey parameter at all.

How to Add Tag via Asana API

I am trying to do a simple Salesforce-Asana integration. I have many functions working, but I am having trouble with adding a tag to a workspace. Since I can't find documentation on the addTag method, I'm sort of guessing at what is required.
If I post the following JSON to https://app.asana.com/api/1.0/workspaces/WORKSPACEID/tasks:
{"data":{"name":"MyTagName","notes":"Test Notes"}}
The tag gets created in Asana, but with blank notes and name fields. If I try to get a bit more fancy and post:
{"data":{"name":"MyTagName","notes":"Test Notes","followers":[{"id":"MY_USER_ID"}]}}
I receive:
{"errors":[{"message":"Invalid field: {\"data\":{\"name\":\"MyTagName\",\"notes\":\"Test Notes\",\"followers\":[{\"id\":\"MY_USER_ID\"}]}}"}]}
I'm thinking the backslashes may mean that my request is being modified by the post, though debug output shows a properly formatted json string before the post.
Sample Code:
JSONGenerator jsongen = JSON.createGenerator(false);
jsongen.writeStartObject();
jsongen.writeFieldName('data');
jsongen.writeStartObject();
jsongen.writeStringField('name', 'MyTagName');
jsongen.writeStringField('notes', 'Test Notes');
jsongen.writeFieldName('followers');
jsongen.writeStartArray();
jsongen.writeStartObject();
jsongen.writeStringField('id', 'MY_USER_ID');
jsongen.writeEndObject();
jsongen.writeEndArray();
jsongen.writeEndObject();
jsongen.writeEndObject();
String requestbody = jsongen.getAsString();
HttpRequest req = new HttpRequest();
req.setEndpoint('https://app.asana.com/api/1.0/workspaces/WORKSPACEID/tags');
req.setMethod('POST');
//===Auth header created here - working fine===
req.setBody(requestbody);
Http http = new Http();
HTTPResponse res = http.send(req);
return res.getBody();
Any help appreciated. I am inexperienced using JSON as well as the Asana API.
The problem was that I was posting to the wrong endpoint. Instead of workspaces/workspaceid/tags, I should have been using /tags and including workspaceid in the body of the request.
Aha, so you can add tags and even set followers despite the API not mentioning that you can or claiming that followers are read-only.
So to sum up for anyone else interested: POSTing to the endpoint https://app.asana.com/api/1.0/tags you can create a tag like this:
{ "data" : { "workspace": 1234567, "name" : "newtagname", "followers": [45678, 6789] } }
where 1234567 is your workspace ID and 45678 and 6789 are your new followers.
Since you posted this question, Asana's API and developer has introduced Tags. You documentation lays out the answer to your question pretty clearly:
https://asana.com/developers/api-reference/tags
I'm a bit confused by your question. Your ask "how to add a tag" but the first half of your question talks about adding a task. The problem with what you describe there is that you are trying to set a task's followers but the followers field is currently read-only according to Asana's API documentation. That is why you are getting an error. You can not set followers with the API right now.
The second part of your question - with the sample code - does look like you are trying to add a tag. However, right now the Asana API does not support this (at least according to the API documentation). You can update an existing tag but you can't add one.
So, to sum up: at this time the API does not allow you to add followers to a task or to create new tags.

Resources