We have integrated Fedex API in a ruby on rails application .
We need nearest drop off locations . We want to filter locations by DANGEROUS_GOODS_SERVICES.
We have checked the fedex locationService pdf file and we found the following xml request format that we are requesting .
Request
<SearchLocationsRequest xmlns="http://fedex.com/ws/locs/v3">
<UserCredential>
<Key>XXXXXXXXXXXX</Key>
<Password>XXXXXXXXXXXXXX</Password>
</UserCredential>
<WebAuthenticationDetail/>
<ClientDetail>
<AccountNumber>XXXXXXXXXX</AccountNumber>
<MeterNumber>XXXXXXXXX</MeterNumber>
<Region>us</Region>
</ClientDetail>
<Version>
<ServiceId>locs</ServiceId>
<Major>1</Major>
<Intermediate>0</Intermediate>
<Minor>0</Minor>
</Version>
<EffectiveDate>2016-04-13</EffectiveDate>
<LocationsSearchCriterion>ADDRESS</LocationsSearchCriterion>
<Address>
<StreetLines>811 E 1950 N</StreetLines>
<City>Spanish Fork</City>
<StateOrProvinceCode/>
<PostalCode>84660</PostalCode>
<UrbanizationCode/>
<CountryCode>US</CountryCode>
<Residential>0</Residential>
</Address>
<PhoneNumber/>
<GeographicCoordinates/>
<MultipleMatchesAction>RETURN_ALL</MultipleMatchesAction>
<SortDetail>
<Criterion>DISTANCE</Criterion>
<Order>LOWEST_TO_HIGHEST</Order>
</SortDetail>
<Constraints>
<RadiusDistance>
<Value>10.0</Value>
<Units>KM</Units>
</RadiusDistance>
</Constraints>
</SearchLocationsRequest>
Response
{"SearchLocationsReply"=>{"HighestSeverity"=>"ERROR", "Notifications"=>{"Severity"=>"ERROR", "Source"=>"prof", "Code"=>"1000", "Message"=>"Authentication Failed"}, "Version"=>{"ServiceId"=>"locs", "Major"=>"1", "Intermediate"=>"0", "Minor"=>"0"}}}
Authentication failed message we are getting, while the same credentails are working for getting rates and labels.
I had the same problem than you, after several hours I discovered that the problem was some invisible characteres copied from the fedex email confirmation. In a text editor was possible to see them:
Be careful with the strange characters at the begin and at the end of the key/passwords.
The problem was solved after strip those characters.
Related
My Custom API's are working fine, I've deployed code on staging Server but I'am getting below error.
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin does not exist. Valid plugin IDs for Drupal\rest\Plugin\Type\ResourcePluginManager are: dblog, file:upload, entity:block, entity:block_content_type, entity:block_content, entity:comment, entity:comment_type, entity:config_pages_type, entity:config_pages, entity:contact_form, entity:contact_message, entity:editor, entity:field_config, entity:field_storage_config, entity:file, entity:filter_format, entity:flagging, entity:flag, entity:google_api_service_client, entity:google_api_client, entity:image_style, entity:menu_link_content, entity:node, entity:node_type, entity:page_variant, entity:page, entity:path_alias, entity:rdf_mapping, entity:rest_resource_config, entity:search_api_task, entity:search_api_server, entity:search_api_index, entity:search_api_autocomplete_search, entity:shortcut_set, entity:shortcut, entity:social_auth, entity:menu, entity:action, entity:taxonomy_term, entity:taxonomy_vocabulary, entity:tour, entity:ultimate_cron_job, entity:user, entity:user_role, entity:webform_options, entity:webform, entity:webform_submission, entity:webform_access_group, entity:webform_access_type, entity:webform_image_select_images, entity:webform_options_custom, entity:view, entity:paragraph, entity:paragraphs_type, entity:base_field_override, entity:entity_view_display, entity:entity_view_mode, entity:entity_form_mode, entity:entity_form_display, entity:date_format, user_registration in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /home1/tourcode/public_html/''/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php)
Thanks in Advance.
Drupal is looking for a plugin with empty string as a name.
I also noticed have some kind of an empty string in your path. (between public_html and web)
/home1/tourcode/public_html/''/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php
It looks like the configuration of your server has a problem.
I'm trying to create an order through the Prestashop API (v1.6.1.13). I havn't written any module, my goal is just to use its API without installing anything on the prestashop.
Creating an order requires a module name. If I leave it blank I get the error:
Validation error: "Property Order->module is empty"
If I write a fake name it says :
Validation error: "Property Order->module is not valid"
What should I do ? While I have the same issue with the payment field ?
Here is what I'm sending :
<prestashop>
<order>
<id_address_delivery>1299</id_address_delivery>
<id_address_invoice>1300</id_address_invoice>
<id_cart>218</id_cart>
<id_currency>1</id_currency>
<id_lang>2</id_lang>
<id_customer>214</id_customer>
<id_carrier>2</id_carrier>
<current_state>2</current_state>
<module></module>
<invoice_number>0</invoice_number>
<delivery_number>0</delivery_number>
<valid>1</valid>
<date_add>2017-06-27 23:00:46</date_add>
<date_upd>2017-06-28 11:50:13</date_upd>
<id_shop_group>1</id_shop_group>
<id_shop>1</id_shop
<payment>MyPayment</payment>
<recyclable>0</recyclable>
<gift>0</gift>
<mobile_theme>0</mobile_theme>
<total_discounts>0</total_discounts>
<total_discounts_tax_incl>0</total_discounts_tax_incl>
<total_discounts_tax_excl>0</total_discounts_tax_excl>
<total_paid>27</total_paid>
<total_paid_tax_incl>27</total_paid_tax_incl>
<total_paid_tax_excl>27</total_paid_tax_excl>
<total_paid_real>27</total_paid_real>
<total_products>27</total_products>
<total_products_wt>27</total_products_wt>
<total_shipping>0</total_shipping>
<total_shipping_tax_incl>0</total_shipping_tax_incl>
<total_shipping_tax_excl>0</total_shipping_tax_excl>
<carrier_tax_rate>0</carrier_tax_rate>
<total_wrapping>0</total_wrapping>
<total_wrapping_tax_incl>0</total_wrapping_tax_incl>
<total_wrapping_tax_excl>0</total_wrapping_tax_excl>
<conversion_rate>1</conversion_rate>
<reference>170627369</reference>
<associations>
<order_rows>
<order_row>
<product_id>2</product_id>
<product_attribute_id>7</product_attribute_id>
<product_quantity>2</product_quantity>
<product_name>Blouse</product_name>
<product_reference>demo_2</product_reference>
<product_ean13>0</product_ean13>
<product_price>27</product_price>
<unit_price_tax_incl>27</unit_price_tax_incl>
<unit_price_tax_excl>27</unit_price_tax_excl>
</order_row>
</order_rows>
</associations>
</order>
</prestashop>
Any help/idea would be greatly appreciate, thanks !
After some debug steps in the payment module I found the solution.
The module should be a valid module name (I use "bankwire") and payment can be wathever you want (the name of the external source for example).
I was testing an address which country was disabled... Enabling the country fix the issue.
What a pity Prestashop doesn't respond the reason on the API call... Even if activating the DEV mode of prestashop and DEBUG of the PaymentModule.
Thanks for your help sarcom !
You need Enable the payment options(like payment by check) in prestashop admin side and then need to add the module with prefix ps_moduleName without any space.
I did like this,
$xml->order->module= "ps_".strtolower(str_replace(' ', '', $order_data['payment_method']));
You can try this if there is any error or If you have any better solution then it me know.
Thanks.
In my scenario UAS receives two Via headers. Using [last_Via:] it replies 183, 200 OK for subsequent PRACK but for 180 Ringing and 200 OK for the original INVITE it needs those two Via headers. How do I store them in a variable so that I can use here ?
Approach that I goggled:
<ereg regexp="[Vv][Ii][Aa][ ]*:[ ](.*)$" search_in="msg" check_it="true" assign_to="1"/>
$1= It has both the Via headers but also the rest of the message including SDP.
<nop>
<action>
<assignstr assign_to="1" value="[last_Via:]" />
</action>
</nop>
Otherwise, using your regex approach, you should be able to consume everything until the next CR LF characters with something like: "[^\r\n]*\r\n".
Do this right before your <send>:
<nop>
<action>
<assignstr assign_to="lvia" value="[last_Via:]" />
<ereg regexp="[Vv][Ii][Aa]: (.*), (.*)" search_in="var" variable="lvia" assign_to="5,6,7"/>
<exec command="echo Via1: [$5], via2: [$6], via3: [$7]"/>
</action>
</nop>
Then use the values store in variables 6 and 7.
This works for 2 Vias, you may need to adapt if you need to handle more.
I'm using magento(EE) Enterprise Edition 1.12 M2e Pro(M2), Channel Advisor (CA) and Shipworks(SW) 3.6.0.4651 sigh.
So here's the scenario. I'm sending inventory from EE to CA, from CA to Amazon, From Amazon to M2, From M2 to EE, From EE to SW.
I created a custom call in EE to grab the amazon order id from M2, then edited the SW php file to pass it as an attribute to SW.
I can see the amazon order Id as an option in SW, and am using this:
<xsl:variable name="option2" select="$order/Item/Option[Name='AmazonOrderId']" />
my output is something like this:
AmazonOrderId109-2691618-61642030AmazonOrderId
How would I go about getting the text "AmazonOrderId" out of the variable Option2 without messing up SW?
Using your example input, $option2 contains:
AmazonOrderId 109-2691618-6164203 0
that is all the text nodes within the <Option> element. Note that the Option ID ("64345020") is not included. Assuming the Order ID here is "109-2691618-6164203", set the variable to:
"$order/Item/Option[Name='AmazonOrderId']/Description"
to grab (only) it. Can't say what will or won't "mess up SW".
You shouldn't place the AmazonOrderId within [] it should be like this
select="$order/Item/Option/Description" />
With the new ability for anyone to see certain insights from pages without admin permissions, I was curious if this extends to the graph api, specifically in regards to the graph of fan growth. If you hover your mouse over a data point, it'll tell you the new fans / 7 days of that particular point in time -- is there any way to query this automatically with either fql or the regular graph api?
I've tried SELECT metric, value FROM insights WHERE object_id = 224383614973 AND metric = 'page_fan_adds' AND end_time=1342915199 AND period=86400 to query the McDonald's Canada new fans for a one-day period, but it requires a valid access_token.
Sorry for the late reply but it might help someone. You can use the graph explorer to build your FQL query:
https://developers.facebook.com/tools/explorer/?method=GET&path=CocaColaCanada%2Finsights
Also all the metrics for the page start with page_ and are available here:
https://developers.facebook.com/docs/reference/api/insights/#page_stories
Some of them are not public.
In all cases you need valid access_token
UPDATE:
I've run a script for macdonald using the 233 metrics that facebook offers to see which one are public metrics for a page. Here is the result:
McDonalds(233 metrics)
application_active_users: no
application_active_users_locale: no
application_active_users_city: no
application_active_users_country: no
application_active_users_gender: no
application_active_users_age: no
application_active_users_gender_age: no
application_installed_users: no
application_installed_users_locale: no
application_installed_users_city: no
application_installed_users_country: no
application_installed_users_gender: no
application_installed_users_age: no
application_installed_users_gender_age: no
application_installation_adds: no
application_installation_adds_unique: no
application_installation_removes: no
application_installation_removes_unique: no
application_tos_views: no
application_tos_views_unique: no
application_permission_views_top: no
application_permission_views_top_unique: no
application_permission_grants_top: no
application_permission_grants_top_unique: no
application_block_adds: no
application_block_adds_unique: no
application_block_removes: no
application_block_removes_unique: no
application_mobile_app_installs: no
application_like_adds: no
application_like_adds_unique: no
application_like_removes: no
application_like_removes_unique: no
application_comment_adds: no
application_comment_adds_unique: no
application_photos: no
application_photos_unique: no
application_shares: no
application_shares_unique: no
application_status_updates: no
application_status_updates_unique: no
application_stream_stories: no
application_stream_stories_unique: no
application_feed_form_views: no
application_feed_form_views_unique: no
application_feed_form_views_login: no
application_feed_form_views_login_unique: no
application_feed_form_views_logout: no
application_widget_activity_views: no
application_widget_activity_views_unique: no
application_widget_activity_views_login: no
application_widget_activity_views_login_unique: no
application_widget_activity_views_logout: no
application_widget_activity_views_external_referrals: no
application_widget_comments_views: no
application_widget_comments_views_unique: no
application_widget_comments_views_login: no
application_widget_comments_views_login_unique: no
application_widget_comments_views_logout: no
application_widget_fan_views: no
application_widget_fan_views_unique: no
application_widget_fan_views_login: no
application_widget_fan_views_login_unique: no
application_widget_fan_views_logout: no
application_widget_fan_views_external_referrals: no
application_widget_like_views: no
application_widget_like_views_unique: no
application_widget_like_views_login: no
application_widget_like_views_login_unique: no
application_widget_like_views_logout: no
application_widget_like_views_external_referrals: no
application_widget_live_stream_views: no
application_widget_live_stream_views_unique: no
application_widget_live_stream_views_login: no
application_widget_live_stream_views_login_unique: no
application_widget_live_stream_views_logout: no
application_widget_live_stream_views_external_referrals: no
application_widget_recommendation_views: no
application_widget_recommendation_views_unique: no
application_widget_recommendation_views_login: no
application_widget_recommendation_views_login_unique: no
application_widget_recommendation_views_logout: no
application_widget_recommendation_views_external_referrals: no
application_widget_share_views: no
application_widget_share_views_unique: no
application_widget_views: no
application_widget_views_unique: no
application_widget_views_login: no
application_widget_views_login_unique: no
application_widget_views_logout: no
application_opengraph_action_create: no
application_opengraph_action_delete: no
application_opengraph_object_create: no
application_opengraph_object_update: no
application_opengraph_story_impressions: no
application_opengraph_story_click: no
application_opengraph_story_like: no
application_opengraph_story_unlike: no
application_opengraph_story_comment: no
application_opengraph_story_hide: no
application_opengraph_story_hide_all: no
application_opengraph_story_report_spam: no
application_opengraph_link_impression: no
application_opengraph_link_click: no
application_opengraph_timeline_impressions: no
application_opengraph_timeline_spam: no
application_opengraph_timeline_clicked: no
application_canvas_views: no
application_canvas_views_unique: no
application_canvas_views_login: no
application_canvas_views_login_unique: no
application_canvas_views_logout: no
application_canvas_views_internal_referrals: no
application_canvas_views_external_referrals: no
application_tab_views: no
application_tab_views_unique: no
application_api_calls: no
application_api_calls_top: no
application_api_calls_unique: no
application_api_errors: no
application_api_errors_rate: no
application_api_errors_top: no
application_api_time_average: no
application_canvas_errors: no
application_canvas_errors_rate: no
application_canvas_time_average: no
page_fans_locale: no
page_fans_city: no
page_fans_country: ok
page_fans_gender_age: no
page_fan_adds: no
page_fan_adds_unique: no
page_fans_by_like_source: no
page_fans_by_like_source_unique: no
page_fan_removes: no
page_fan_removes_unique: no
page_friends_of_fans: no
page_tab_views_login_top_unique: no
page_tab_views_login_top: no
page_views: no
page_views_unique: no
page_views_login: no
page_views_login_unique: no
page_views_logout: no
page_views_external_referrals: no
page_posts_impressions: no
page_posts_impressions_unique: no
page_posts_impressions_paid: no
page_posts_impressions_paid_unique: no
page_posts_impressions_organic: no
page_posts_impressions_organic_unique: no
page_posts_impressions_viral: no
page_posts_impressions_viral_unique: no
page_posts_impressions_frequency_distribution: no
post_stories: no
post_storytellers: no
post_stories_by_action_type: no
post_storytellers_by_action_type: no
post_impressions: no
post_impressions_unique: no
post_impressions_paid: no
post_impressions_paid_unique: no
post_impressions_fan: no
post_impressions_fan_unique: no
post_impressions_fan_paid: no
post_impressions_fan_paid_unique: no
post_impressions_organic: no
post_impressions_organic_unique: no
post_impressions_viral: no
post_impressions_viral_unique: no
post_impressions_by_story_type: no
post_impressions_by_story_type_unique: no
post_consumptions: no
post_consumptions_unique: no
post_consumptions_by_type: no
post_consumptions_by_type_unique: no
post_engaged_users: no
post_negative_feedback: no
post_negative_feedback_unique: no
post_negative_feedback_by_type: no
post_negative_feedback_by_type_unique: no
domain_feed_clicks: no
domain_feed_views: no
domain_stories: no
domain_widget_comments_adds: no
domain_widget_comments_views: no
domain_widget_comments_feed_views: no
domain_widget_comments_feed_clicks: no
domain_widget_like_views: no
domain_widget_likes: no
domain_widget_like_feed_views: no
domain_widget_like_feed_clicks: no
domain_widget_send_views: no
domain_widget_send_clicks: no
domain_widget_send_inbox_views: no
domain_widget_send_inbox_clicks: no
page_stories: no
page_storytellers: no
page_stories_by_story_type: no
page_storytellers_by_story_type: no
page_storytellers_by_age_gender: no
page_storytellers_by_country: ok
page_storytellers_by_locale: no
page_impressions: no
page_impressions_unique: no
page_impressions_paid: no
page_impressions_paid_unique: no
page_impressions_organic: no
page_impressions_organic_unique: no
page_impressions_viral: no
page_impressions_viral_unique: no
page_impressions_by_story_type: no
page_impressions_by_story_type_unique: no
page_impressions_by_city_unique: no
page_impressions_by_age_gender_unique: no
page_impressions_frequency_distribution: no
page_impressions_viral_frequency_distribution: no
page_engaged_users: no
page_consumptions: no
page_consumptions_unique: no
page_consumptions_by_consumption_type: no
page_consumptions_by_consumption_type_unique: no
page_places_checkin_total: no
page_places_checkin_total_unique: no
page_places_checkin_mobile: no
page_places_checkin_mobile_unique: no
page_places_checkins_by_age_gender: no
page_places_checkins_by_locale: no
page_places_checkins_by_country: no
page_negative_feedback: no
page_negative_feedback_unique: no
page_negative_feedback_by_type: no
page_negative_feedback_by_type_unique: no
Started at: 2013-04-17 02:14:29
Ended at: 2013-04-17 02:17:13
Second elapsed: 164s
enter code here