error:999 with Alchemy API to extract microformats - ibm-cloud

I'm trying to use alchemy API to export microformats, I always have the same error
cannot-retrieve:downstream-http-error:999
Here is the call I use : http://gateway-a.watsonplatform.net/calls/url/URLGetMicroformatData?apikey=MYAPIKEY&url=http://fr.linkedin.com/in/laurentpauc
Any idea why ?

well, I've tried here twice.
In the first attempt, it failed just like you've said.
In the second attempt, it worked.
<?xml version="1.0" encoding="UTF-8"?>
<results>
<status>OK</status>
<usage>By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html</usage>
<url>https://www.linkedin.com/in/laurentpauc</url>
<microformats>
<microformat>
<field>NameGivenName</field>
<data>Laurent</data>
</microformat>
<microformat>
<field>NameFamilyName</field>
<data>Pauc</data>
</microformat>
<microformat>
<field>AddrLocality</field>
<data>Saint-Denis, Île-de-France, France</data>
</microformat>
<microformat>
<field>FormattedName</field>
<data>Laurent Pauc</data>
</microformat>
<microformat>
<field>OrgName</field>
<data>ESPACE BUROCOM</data>
</microformat>
<microformat>
<field>Title</field>
<data>Responsable Marketing chez Espace Burocom • Concessionnaire Xerox</data>
</microformat>
</microformats>
</results>
So I think this may be some temporary issue.

Related

How to limit transaction scope to just the JPA updating outbound gateway (sort of "auto-commit") in Spring Integration

I have an integration flow which starts with a poller. This DOES NOT open a transaction.
Down that flow I have a JPA updating outbound gateway:
<int-jpa:updating-outbound-gateway
request-channel="requestChannel"
reply-channel="replyChannel"
named-query="myUpdatingJpqlQuery"
entity-manager-factory="entityManagerFactory">
<int-jpa:transactional
transaction-manager="transactionManager" />
<int-jpa:parameter name="param1" expression="payload" />
<int-jpa:parameter name="param2"
expression="T(java.time.Instant).now()" />
</int-jpa:updating-outbound-gateway>
This works, however, the transaction that this gateway opens embraces the whole downstream flow (unless I break the transaction boundary with an executor). This is not what I want in this case: I would like the transaction to just embrace the updating operation (some sort of "auto-commit"), because the downstream flow will handle transactions in a more granular way and needs to handle independent transactions (not to join an outer one).
This indeed seems to be confirmed by the documentation: https://docs.spring.io/spring-integration/docs/5.4.11/reference/html/messaging-endpoints.html#tx-handle-message-advice
If I understand that linked section well, if I instead use a <request-handler-advice-chain> with a <tx:advice> I should get the desired result.
However, if I use this:
<int-jpa:updating-outbound-gateway
request-channel="requestChannel"
reply-channel="replyChannel"
named-query="myUpdatingJpqlQuery"
entity-manager-factory="entityManagerFactory">
<int-jpa:parameter name="param1" expression="payload" />
<int-jpa:parameter name="param2"
expression="T(java.time.Instant).now()" />
<int-jpa:request-handler-advice-chain>
<tx:advice transaction-manager="transactionManager" />
</int-jpa:request-handler-advice-chain>
</int-jpa:updating-outbound-gateway>
I get a javax.persistence.TransactionRequiredException, so it seems like that advice is not working (at least not in the way I want).
What is the better way to do this? Am I forced to use a dispatcher with an executor on the reply channel to break the transaction boundary?
Make it like this:
<tx:advice>
<tx:attributes>
<tx:method name="*"/>
</tx:attributes>
</tx:advice>
It does not have any method matches by default therefore such an advice is not applied to the internal AdvisedRequestHandler.

Extract only data (without response element) using MarkLogic search API with REST

When making REST endpoint call to MarkLogic, is there an option to get only the data in the response without the additional metadata?
I am trying to use to make such connections using tools like Tableau, Qlik, Denodo etc
Options I use in the POST body on the URL: http://localhost:8000/v1/search
<search xmlns="http://marklogic.com/appservices/search">
<options>
<extract-document-data selected="all"></extract-document-data>
<transform-results apply="raw" />
</options>
</search>
Result I get:
<search:response snippet-format="raw" total="150" start="1" page-length="10" selected="all" xmlns:search="http://marklogic.com/appservices/search">
<search:result index="1" uri="/doc/21_doc.xml" path="fn:doc("/doc/21_doc.xml")" score="0" confidence="0" fitness="0" href="/v1/documents?uri=%2Fdoc%2F21_doc.xml" mimetype="application/xml" format="xml">
<root>
<col1>data1</col1>
<col2>data1</col2>
<col3>data1</col3>
</root>
<search:extracted kind="element">
<root>
<col1>data1</col1>
<col2>data1</col2>
<col3>data1</col3>
</root>
</search:extracted>
</search:result>
<search:metrics>
<search:query-resolution-time>PT0.0005236S</search:query-resolution-time>
<search:snippet-resolution-time>PT0.0001001S</search:snippet-resolution-time>
<search:extract-resolution-time>PT0.0003971S</search:extract-resolution-time>
<search:total-time>PT0.0021503S</search:total-time>
</search:metrics>
</search:response>
Expected:
<search:extracted kind="element">
<root>
<col1>data1</col1>
<col2>data1</col2>
<col3>data1</col3>
</root>
</search:extracted>
Also, why am I getting data in both extracted and result elements?
Both snippeting and data extraction provide access to content. Use either, or use them for different purposes. If you only like to get extracted data, then use:
<transform-results apply="empty-snippet" />
HTH!
If you want the original documents, specify an Accept header of multipart-mixed and specify only the content value for the a category URI parameter.
See: https://docs.marklogic.com/REST/POST/v1/search
and https://docs.marklogic.com/guide/rest-dev/bulk#id_65903
As an alternative, you may find it easier to provide rows to Business Intelligence Tools by creating TDE indexes and paging over an Optic query with the /v1/rows endpoint.
See: https://docs.marklogic.com/guide/rest-dev/search#id_34628
and https://docs.marklogic.com/REST/POST/v1/rows
Hoping that helps,

QBXML Receive payment applied to multiple Invoices

I'm trying to apply 1 payment to multiple invoices with QBXML and I'm getting the following error
QuickBooks found an error when parsing the provided XML text stream
My XML:
<?xml version="1.0" encoding="utf-8"?><?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<ReceivePaymentAddRq>
<ReceivePaymentAdd>
<CustomerRef>
<ListID>8000254C-1444676392</ListID>
</CustomerRef>
<TxnDate>2018-12-13</TxnDate>
<RefNumber>457</RefNumber>
<TotalAmount>863.10</TotalAmount>
<Memo></Memo>
<PaymentMethodRef><FullName/></PaymentMethodRef>
<AppliedToTxnAdd>
<TxnID>11B0C6-1544760951</TxnID>
<PaymentAmount>179.00</PaymentAmount>
</AppliedToTxnAdd>
<AppliedToTxnAdd>
<TxnID>11B0CA-1544761043</TxnID>
<PaymentAmount>684.10</PaymentAmount>
</AppliedToTxnAdd>
</ReceivePaymentAdd><IncludeRetElement>TxnID</IncludeRetElement><IncludeRetElement>RefNumber</IncludeRetElement></ReceivePaymentAddRq></QBXMLMsgsRq></QBXML>
Notice I have 2 AppliedToTxnAdd elements.
However if I only apply 1 AppliedToTxnAdd, it works!
The issue was the order of the xml elements. QB cares about that.

ZOQL Execution via Zuora REST API

I am trying to execute some ZOQL via Zuora REST API.
I've referred this doc and I am using REST endpoint v1/action/query to execute ZOQL.
First I tried with very simple request and got the result back
{
"queryString": "select AccountId, FirstName, LastName from contact"
}
Now I tried query with asterisk like below
{
"queryString": "select * from contact"
}
But I got below error
{
"faultcode": "fns:MALFORMED_QUERY",
"faultstring": "You have an error in your ZOQL syntax",
"detail": {
"MalformedQueryFault": {
"FaultCode": "MALFORMED_QUERY",
"FaultMessage": "You have an error in your ZOQL syntax"
}
}
}
From here, I found that ZOQL supports asterisk. I even got the same error for ZOQL which involves multiple objects. Like
SELECT Subscription.Name, Account.Name FROM Subscription WHERE Subscription.Status='Active' AND DefaultPaymentMethod.CreditCardType='Visa'
EDIT
Above query does not work in Zuora SOAP API as well
How can I execute query with asterisk in Zuora REST API or in Zuora SOAP API?
Queries With Asterix In ZOQL:
In short: You just can't use asterix.
More info:
From Zuora KnowledgeCenter:
No Wild Card Support
You cannot use the asterisk wild card (*) for field names with a
query() call. You must explicitly specify a field name.
The above source you mentioned stating that you can use asterix, is NOT about ZOQL, but about Export ZOQL.
Export ZOQL is different from ZOQ, as stated in the docs above:
Zuora Export ZOQL (Zuora Object Query Language) is the query language
used to create Exports with the Export object in the Zuora SOAP API.
Zuora Export ZOQL is similar to our general ZOQL, with a few
differences. The biggest difference is that with Exports, you query a
Zuora data source, not a SOAP API object.
Hope this helps you.
Good luck!
When you use a * in query it is because:
1) you want all the fields available
OR
2) you want to find out WHAT fields are available.
For the later case, use the Describe function of the REST service as in:
https://{servicename}.zuora.com:####/v1/describe/Invoice
which will return an XML description of the Invoice (or any other) object as:
<?xml version="1.0" encoding="UTF-8"?>
<object href="https://services470.zuora.com/apps/api/describe/Invoice">
<name>Invoice</name>
<label>Invoice</label>
<fields>
<field>
<name>AccountId</name>
<label>Account ID</label>
<selectable>true</selectable>
<createable>true</createable>
<updateable>false</updateable>
<filterable>true</filterable>
<custom>false</custom>
<maxlength></maxlength>
<required>true</required>
<type>text</type>
<contexts>
<context>soap</context>
</contexts>
</field>
<field>
<name>AdjustmentAmount</name>
<label>Adjustment Amount</label>
<selectable>true</selectable>
<createable>false</createable>
<updateable>false</updateable>
<filterable>true</filterable>
<custom>false</custom>
<maxlength></maxlength>
<required>true</required>
<type>decimal</type>
<contexts>
<context>soap</context>
<context>export</context>
</contexts>
</field>
<!-- All fields for Invoice...ETC -->
</fields>
</object>

What is the name of form field where XML belongs to when sending an HTTP POST request to post a job using LinkedIn API

I am looking into the following page to post a job to LinkedIn using their API:
http://developer.linkedin.com/documents/posting-job
I am given a sample XML message (as shown below) and a URL to direct HTTP POST request to. However, one thing is not clear to me which HTML form field I will insert XML content to? In other words, what is the name of this FORM field?
URL to direct HTTP POST request to: http://api.linkedin.com/v1/jobs
Sample XML:
<?xml version="1.0" encoding="UTF-8"?>
<job>
<partner-job-id>LIJ-13239292</partner-job-id>
<contract-id>1234</contract-id>
<customer-job-code>DE247X</customer-job-code>
<company>
<id>1234</id>
<name>Company ABC</name>
<description>A great company</description>
</company>
<position>
<title>Chief Architect</title>
<description>This is a great job.</description>
<skills-and-experience>Programming, financial analysis, and thought leadership.</skills-and-experience>
<location>
<country>
<code>us</code>
</country>
<postal-code>10012</postal-code>
<name>Midtown Manhattan</name>
</location>
<job-functions>
<job-function>
<code>acct</code>
</job-function>
<job-function>
<code>dsgn</code>
</job-functions>
</job-functions>
<industries>
<industry>
<code>38</code>
</industry>
<industry>
<code>44</code>
</industry>
</industries>
<job-type>
<code>C</code>
</job-type>
<experience-level>
<code>4</code>
</experience-level>
</position>
<salary>$100,000-120,000 per year</salary>
<referral-bonus>$5,000 for employees</referral-bonus>
<poster>
<display>true</display>
<role>
<code>R</code>
</role>
<email-address>user#contract.com</email-address>
</poster>
<how-to-apply>
<application-url>http://www.linkedin.com</application-url>
</how-to-apply>
<tracking-pixel-url>http://www.linkedin.com/track.gif</tracking-pixel-url>
</job>