Error while creating custom story on Facebook with Koala - ruby-on-rails

I am trying to use Koala gem to publish custom open graph stories to the Facebook timeline of the users of my Rails application. The application has already been approved to publish this custom story batalharia:battle, but when I try to share the user story there is the following error:
Koala::Facebook::ClientError (type: OAuthException, code: 100, error_subcode: 1611008, message: Invalid parameter, error_user_title: Object Missing a Required Value, error_user_msg: Object at URL 'https://batalharia.com/pt-BR/battles/27' of type 'website' is invalid because a required property 'og:title' of type 'string' was not provided. [HTTP 400]):
app/controllers/users/omniauth_callbacks_controller.rb:95:in `share_battle_on_facebook'
app/controllers/users/omniauth_callbacks_controller.rb:19:in `facebook'
The error message says that the type is website and that og:title was not provided, but my page is configured with og:type with batalharia:battle and og:title was provided.
The page I am trying to share is this one: https://batalharia.com/battles/27
And the Koala code is:
def share_battle_on_facebook(credentials, battle_id)
#graph = Koala::Facebook::API.new(credentials.token)
#graph.put_connections("me", "batalharia:create", battle: battle_url(battle_id))
end
Has someone faced this problem and knows how to fix it?
Any help would be extremely appreciated.
Edit:
If I fetch new scrape information for the page in the facebook developers debug page, I get this error:
Meta Tags In Body: Your page has meta tags in the body instead of the
head. This may be because your HTML was malformed and they fell lower
in the parse tree. Please fix this in order for the tags to be usable.
But the meta tags are in head and the HTML is ok. Despite the error pointed out, the tags are correctly identified and parsed by the debug page.

Related

Filtering on recent files Microsoft Graph API not working

I am trying to fetch recently accessed items for a user using this endpoint. While fetching the items themselves works, I am unable to filter on lastModifiedDateTime, which is a property of the API response, as per this link.
I am making a GET request to the following endpoint:
https://graph.microsoft.com/v1.0/me/drive/recent?$filter=lastModifiedDateTime ge 2020-08-25T05:30:00Z
And I am getting a Microsoft.SharePoint.Client.InvalidClientQueryException with the following message:
'The expression "lastModifiedDateTime ge 2020-08-25T05:30:00Z" is not valid.'
Please help!
The error which is showing up says 'The expression "lastModifiedDateTime ge 2020-08-25T05:30:00Z" is not valid' which means the expression which you have given in the filter is not right. You need to correct it as shown below.
https://graph.microsoft.com/v1.0/me/drive/recent?$filter=lastModifiedDateTime ge '2020-08-25T05:30:00Z'
But still this call doen't work because the filter is not supported on this property and you will end up 'Invalid filter clause'.
As a work around you can get the recent files and filter it on your end as most of the properties doesn't support filtering yet.

REST API error while posting a customized Priority fields

I'm trying to post REST API of the ORDERS form.
I have added a few customized fields to the sub form PAYMENTDEF in order to post all the credit cards information.
I'm getting the error:
'An error has occurred'
any time I'm posting the customized fields, if I remove them from the request I managed to post.
{"CUSTNAME":"5","CDES":"רועי בן מנחם","CURDATE":"2018-07-18","BOOKNUM":"2164","SHIPTO2_SUBFORM":{"NAME":"רועי בן מנחם","PHONENUM":"0507573753","ADDRESS":"דן 4","STATE":"שערי תקווה","COUNTRYNAME":"Israel","ZIP":"44810","ADDRESS2":"44"},"ORDERITEMS_SUBFORM":[{"PARTNAME":"CLEAN0044","TQUANT":1,"PRICE":19.9,"REMARK1":"","ROYY_ORDISPECS_SUBFORM":[]},{"PARTNAME":"000","TQUANT":1,"PRICE":30,"REMARK1":""}],"PAYMENTDEF_SUBFORM":{"PAYMENTCODE":"3","QPRICE":53.28,"PAYACCOUNT":"1234","PAYCODE":"","VALIDMONTH":"0124","CCUID":"123456789","CONFNUM":"09090909","ROYY_NUMBEROFPAY":"","FIRSTPAY":"","ROYY_SECONDPAYMENT":""}}
And this is my header:
https://pri.officeandmore.co.il/odata/Priority/tabula.ini/tirgul2/ORDERS
Try check if these fields are visible in the REST api service:
Request the service metadata as following:
https://pri.officeandmore.co.il/odata/Priority/tabula.ini/tirgul2/$metadata
In the result check for the PAYMENTDEF subform's metadata (search for <EntityType Name="PAYMENTDEF"> and check if your customized fields appear in the property (field) list.
If they don't appear, probably these fields are set as 'hidden fields' in the 'Priority form' or that you have permission limitations.
If they do appear, the problem is probably related to incorrect values you are trying to post to these fields. Take a look in the metadata result to see the expected values format for each of these fields.

Umbraco 404 Issue

I have setup 404 redirection successfully for an umbraco project. If the user navigates to a page that doesn't exist it shows the designated node id.
However consider this:
http://tsw/course-calendar/ - Correct Link
http://tsw/coursecalendar/ - Doesn't 404 (but should)
http://tsw/coursecalenda/ - 404 redirects
In the example above the correct link as per umbraco is the second however if I remove the dash but leave the words I get a Server error:
The model item passed into the dictionary is of type 'Castle.Proxies.HomepageDTProxy', but this dictionary requires a model item of type 'TSW.Web.ViewModels.CourseCalendarVM'.
It's like the page is trying to resolve the URL.
How do I stop this behaviour in Umbraco so that only full and accurate links are opened and the remaining are 404 redirected?
Do you have a doctype or template named coursecalendar? Then that might be it. If so, there are options to disable the URL resolving, see https://our.umbraco.com/forum/templates-partial-views-and-macros/ . The "switch" is disableAlternativeTemplates in umbracoSettings.config

How can I content-partner and can-read-video-streams roles from Dailymotion?

I try to retrieve an HLS stream URL of my videos on Dailymotion, calling /video/ API with stream_hls_url value in the fields parameter. But I get a 403 error with the following message:
Unsufficient roles for the 'fields' parameter of 'GET /video/<id>' with 'stream_hls_url' value, roles required: content-partner, can-read-video-streams
How could I obtain these roles, given that I'm a Dailymotion partner?
You should either contact your Dailymotion content manager if you have one, or get in touch with us by writing your request to https://faq.dailymotion.com/hc/en/requests/new
Anyone coming to this question with a similar response from an API request; please check the fields you're requesting within your request against those listed in the Dailymotion API Data API Reference.
Often this "403" response, seemingly due to "Unsufficient Roles" (yes that's a typo), is actually down to requesting a field that no longer exists within the defined reference (linked above). This happens more than it should, with little or no notice to the end user - as demonstrated here.
I hope this helps :)

OAuth Console Not Returning all fields for Honors and Awards

I'm new here, so please bear with me if I am posting to the wrong place.
When using the OAuth console, I am not able to retrieve all the fields under 'Honors & Awards' (URL: http://api.linkedin.com/v1/people/~/honor-awards). It appears I am only able to retrieve the id, name and issuer attributes.
<honors-awards total="2">
<honor-award>
<id>2</id>
<name>Test Honors</name>
<issuer>体育爱好者协会</issuer>
</honor-award>
<honor-award>
<id>3</id>
<name>Test Honors2</name>
<issuer>TS</issuer>
</honor-award>
</honors-awards>
Also, under the profile fields documentations, certifications appears to have 6 attributes in total, but when returning the XML when using http://api.linkedin.com/v1/people/~/certifications as the URL in the OAuth console, it only returns the following:
<certifications total="1">
<certification>
<id>4</id>
<name>Test Certification</name>
</certification>
</certifications>
Might there be something wrong that I am doing? Any comment would be greatly appreciated. Thanks!
I had the same problem. For some reason you have to specify fields for all the children of some collections. See examples of getting the syntax here:
How to Retrieve all possible information about a LinkedIn Account
If you use the JS API, it will be specified in the .fields such as:
.fields(["id", "firstName", "lastName", "certifications:(id,name,authority:(name),number,start-date,end-date)"])

Resources