I'm working on a bixby capsule. I have the following authorization.bxb
authorization{
user {
oauth2-authorization-code (Sample Provider) {
client-id ("BixbyCapsule")
client-secret-key ("key")
authorize-endpoint (example.com/oauth2/authorize)
token-endpoint (example.com/oauth2/token)
}
}
}
After getting redirected from authorization endpoint and when getting the tokens I am getting the error saying access_token too long for the field. Our token is about 3100 characters long.
Org.jooq.exception.DataAccessException: SQL [INSERT INTO `access_keys` ( `user_id`, `capsule_id`, `provider_hash`, `provider_scope`, `access_token`, `refresh_token`, `expiration` ) VALUES ( ?, ?, ?, ?, ?, ?, ? ) ON DUPLICATE KEY UPDATE `access_keys`.`access_token` = ?, `access_keys`.`refresh_token` = ?, `access_keys`.`expiration` = ?]; Data truncation: Data too long for column 'access_token' at row 1
Since the token contains scope of the token, we can't make the it shorter and it already being used with other virtual assistance.
Is there any workaround to save and use the tokens? or is there anyway I can change the column length of the tokens?
This issue may be specific to your use case. Please reach out to the support team via the Contact Support option in the Help dropdown menu in Bixby Developer Studio.
Related
I have a question if anyone would be so kind to help me? :) Could you help me with a little bit of code regarding dictionaries within dictionaries:
A simple program that prompts a user for an email address (that must be stored in the database) in order to gain access to the webpage
Here we shall build dictionaries to hold the data... within a dictionary that will hold the entire database:
database_of_users = {
"Cleaus": {"email" : "c#gmail.com"},
"Jay" : {"email" : "j#hotmail.com"},
"Tremaine" : {"email" : "t#gmail.com"},
"Kyla" : {"email" : "k#outlook.com"}
}
Next bit:
user_email = input("To gain access to this feed, you must be a member
of the site. \n\nIf you are already a member, please enter your
email address below: \n\n").strip().lower()
Then:
while True:
if "#gmail.com" in user_email or "#hotmail.com" in user_email or
"#outlook.com" in user_email:
break
elif "#gmail.com" not in user_email or "#hotmail.com" not in
user_email or "#outlook.com" not in user_email:
user_email = input("\nPlease enter a valid email
address (gmail/hotmail/outlook): \n\n").strip().lower()
Here I am stuck on how to search all of the secondary (nested) dictionary value entries within the main dictionary. I have tried turning it into a list first and then calling what I thought would be the value entries in the second dictionary to query them, but it is not working:
database_aslist = list(database_of_users.values()
I realise the if statement below is just calling the first bit before the 'item' = (key:value), so in this case the name "Cleaus", "Jay","Tremaine","Kyla", but I am just unsure of how to query all data within the main dictionary completely, keys and values included, at the same time? Is it possible?
if user_email in database_of_users:
print("\nOk, I have found you. Please enjoy the show!")
print("\n\n[GAINED ENTRY]")
if user_email not in database_of_users:
print("\nSorry, that email address does not seem to be in our database.
To gain access, please register for one of our packages here:
\n\n[LINK WHERE THEY CAN SIGN UP]\n\nThank you!\n")
Thanking you all in advance for your help!
I've never known a way without walking through the dictionary. Something like this:
user_found=False
for user in database_of_users:
if database_of_users[user]["email"]==user_email:
user_found=True
break
if user_found:
print("\nOk, I have found you. Please enjoy the show!")
print("\n\n[GAINED ENTRY]")
else:
print("\nSorry, that email address does not seem to be in our database.
To gain access, please register for one of our packages here:
\n\n[LINK WHERE THEY CAN SIGN UP]\n\nThank you!\n")
Though, if email is what is being entered, changing the database_of_users to use emails in the first nesting might be the easier way to go if that's an option:
database_of_users={
"c#gmail.com": {"name":"Cleaus"},
"j#hotmail.com": {"name":"Jay"},
...
}
I am trying to retrieve sorted/filtered rows from Excel using Microsoft Graph API but no matter what URL structure (I tried many) I try, the results are not sorted.
The only way I managed was by sorting the original table (i.e. not using a workbook-session-id) but that is not an option for me. I must not affect the spreadsheet.
POST https://graph.microsoft.com/v1.0/groups/<groupid>/drive/root:/test.xlsx:/workbook/createSession
BODY => {persistChanges:false}
// retrieved the id
POST https://graph.microsoft.com/v1.0/groups/<groupid>/drive/root:/test.xlsx:/workbook/worksheets('test')/tables('test')/sort/apply
HEADER => workbook-session-id: session_Id
BODY => { fields: [{ key: column, ascending: false }], hasHeaders: true}
POST https://graph.microsoft.com/v1.0/groups/<groupid>/drive/root:/test.xlsx:/workbook/worksheets('test')/tables('test')/columns('description')/filter/apply
HEADER => workbook-session-id: session_Id
BODY => { criteria: { filterOn: "Custom", criterion1: "=" + filter, operator: "Or", criterion2: null } }
GET https://graph.microsoft.com/v1.0/groups/<groupid>/drive/root:/test.xlsx:/workbook/worksheets('test')/tables('test')/range/visibleView/rows?$select=values
The rows are returned filtered but not sorted. Ideally I would prefer to sort after filtering but I could not figure out the URL to use.
Excel API does not support sorting through the URL sort command. It has to be done at the file level. The persistChanges:false will ensure that file is not saved. Could you not sort, filter and get the visibleView from that series of action? Note that you still need to use the workbook-session-id header. It's just that when you set the persist change to false, the changes you make doesn't get saved to the server. However, you can continue to interact for the length of that non-persistent session. When you don't use the session Id, the request is treated as a persist command (though lot slower).
Im having problem with my UPDATE code., since i'm new at php, im trying to figure out what's been the prolem with my UPDATE command here's my line of code. My insert and delete commands are good to go but this one gives me a headache for 4 hours now.
<?php
include 'includes/conn.php';
if($_POST){
//write query
$sql = "UPDATE
member
SET
fname = ?,
lname = ?,
mname = ?,
email = ?,
address = ?,
gender = ?,
contact = ?,
email = ?,
username = ?,
password = ?
WHERE
mem_id = ?";
$stmt = $mysqli->prepare($sql);
$stmt->bind_param(
'sssssssssi',
$_POST['fname'],
$_POST['lname'],
$_POST['mname'],
$_POST['email'],
$_POST['address'],
$_POST['gender'],
$_POST['contact'],
$_POST['username'],
$_POST['password'],
$_POST['mem_id']
);
if($stmt->execute()){
echo "User was updated.";
$stmt->close();
}else{
die("Unable to update.");
}
}
$sql = "SELECT
fname, lname, mname, email, address, gender, contact, username, password, mem_id
FROM
member
WHERE
mem_id = \"" . $mysqli->real_escape_string($_GET['mem_id']) . "\"
LIMIT
0,1";
$result = $mysqli->query( $sql );
$row = $result->fetch_assoc();
extract($row);
$result->free();
$mysqli->close();
?>
hope you guys could help o by the way it gives me this error
Undefined index: mem_id in C:\xampp\htdocs\prjTheVillagePlaygroup\execute_editmenu.php on line 134
Warning: extract() expects parameter 1 to be array, null given in C:\xampp\htdocs\prjTheVillagePlaygroup\execute_editmenu.php on line 141
You have
email = ?
listed twice in the update statement. Delete the second one.
Note that your binding does not have to change. It will have the correct number of parameters after the deletion.
Also, you are using $_GET['mem_id'] where it should likely be $_POST['mem_id'] - all your other variables are set with $_POST
With regard to Warning: extract() expects parameter 1 to be array, null given, this is due to the query failing.
Check for the $result to make sure the query succeeded and what the error is:
$result = $mysqli->query( $sql );
if (!$result)
printf("Error: " . mysqli->error); // or use die("Error: " . mysqli->error)
}
$row = $result->fetch_assoc();
extract($row);
I am very new to CRM development, i was trying to follow this article, i am a bit confused about below code, please check:
var xp = Xrm.Page;
function onLoad(context) {
var accountId = xp.data.entity.getId();
var mostRecentQuery = "/XRMServices/2011/organizationData.svc/ContactSet?
$select=FullName,JobTitle,EMailAddress1,Telephone1&$top=1&$orderby=CreatedOn
desc&$filter=ParentCustomerId/Id eq guid'" + accountId + "'";
getContact(mostRecentQuery, "MostRecent");
....
}
The above javascript function executes when AccountForm is opened. The first line gets the accountId. the next line is oData query.
Now check the ContactSet in this query, i am confused here, how we can retrieve the ContactEntity based on the GUID of AccountEntity?
I found the answer!
Actually there a Lookup 'Parent Customer' on ContactEntity, it represents the unique identifier of the account or contact associated with this contact, so we can select an Account/Contact as the Parent Customer of a contact.
So this given OData query actually retrieves the top 1 contact where this account is referenced.
I hope its clear.
I'm having trouble saving a record in Subsonic 3 using Active record. I've generated my objects using the DALs and tts and everything seems fine because the following test passes. I think that my connection string is correct or the generation wouldn't have succeeded.
[Test]
public void TestSavingAnEmail()
{
Email testEmail = new Email();
testEmail.EmailAddress = "newemail#test.com";
testEmail.Subscribed = true;
testEmail.Save();
Assert.AreEqual(1, Email.All().Count());
}
On the live side, the following code fails:
protected void btEmailSubmit_Click(object sender, EventArgs e)
{
Email email = new Email();
email.EmailAddress = txtEmail.Text;
email.Subscribed = chkSubscribe.Checked;
email.Save();
}
with a message of: Need to specify Values or a Select query to insert - can't go on! at the following line repo.Add(this,provider); line in my ActiveRecord.cs:
public void Add(IDataProvider provider){
var key=KeyValue();
if(key==null){
var newKey=_repo.Add(this,provider);
this.SetKeyValue(newKey);
}else{
_repo.Add(this,provider);
}
SetIsNew(false);
OnSaved();
}
Am I doing something horribly wrong here? The save and add methods have parameterless overloads that I thought were safe to use. Do I need to pass a provider? I've googled around for this for a while and was unable to come up with anything specific to my situation. Thanks in advance for any kind of answer.
The schema for the table is:
USE [xxxx]
GO
/****** Object: Table [dbo].[Emails] Script Date: 03/11/2010 13:15:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Emails](
[Id] [int] IDENTITY(1,1) NOT NULL,
[V_EmailAddress] [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[B_Subscribed] [bit] NOT NULL,
[DT_CreatedOn] [datetime] NOT NULL,
[DT_ModifiedOn] [datetime] NOT NULL,
CONSTRAINT [PK_Emails] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
There is only 1 warning during generation and that is
Multiple template directives were found in the template. All but the first one will be ignored. Multiple parameters to the template directive should be specified within one template directive.
Settings.ttinclude
The select error you're seeing is SubSonic trying to pull out the newly-created PK, and it can't. So, be sure you have a Primary Key defined for your table. Next - make sure it's set to Auto Increment :).
If that doesn't do it - kick up SQL Profiler and see what's happening. Also - if you could put the schema of your table here so I could see it, that would be helpful (just edit your message).
This should generally work.
A few possible points of failure come to my mind:
Are you using a standard MSSQL provider (database)?
Did you provide a connection string in the web.config (website) or app.config (class library project)?
Did you set a primary key column in the database?
Is your table using multiple primary key columns? Subsonic can't handle that. Use a single artificial ID column (uniqueidentifier or int) in that case.
If the primary key value is an integer field: does it auto-increment the id values? Otherwise you'd have to set the primary key value on your email object before saving it.