A great thanks to #Andreas for answering my question at Podio : Troubles assigning reference for a Relationship app field, it helped me finding the special settings for all podio app fields.
Anyway, I still can't assign referenced apps to relationship app fields.
I've tried to create app with all the fields the following way :
$attributes = array(
"space_id" => $ws->space_id,
"config" => array(
"icon" => DEFAULT_APP_ICON,
"item_name" => "Test App",
"name" => "TestApp"
),
"fields" => array(
array (
"type" => "app",
"external_id" => "test-reference-field",
"config" => array (
"label" => "Test field",
"settings" => array(
"referenced_apps" => array(array("app_id" => 10048654))
)
)
)
)
);
$app = new PodioApp($attributes);
But it does not create the app at all in the given workspace, so I created the app by calling static create() method instead:
$app = PodioApp::create($attributes);
Indeed, the app is created in the right workspace but the referenced app is not linked at all.
So, would it be an API bug or anything else I skipped in my code? Any help would be appreciated
Thanks
The documentation is wrong and you should be using referenceable_types for your settings key and the value should just be an array of app_ids.
$attributes = array(
"space_id" => $ws->space_id,
"config" => array(
"icon" => DEFAULT_APP_ICON,
"item_name" => "Test App",
"name" => "TestApp"
),
"fields" => array(
array (
"type" => "app",
"external_id" => "test-reference-field",
"config" => array (
"label" => "Test field",
"settings" => array(
"referenceable_types" => array(233461, 233464)
)
)
)
)
);
$app = PodioApp::create($attributes);
Related
I am working on project in which I need to use DocuSign API (PHP). This is my first experience with DocuSign and I successfully made template in DocuSign Console with roleName = signer. There I also made Custom Text Tags: address, city, state and phone and drag them to the desired location in my template. I want there to put my customer (signer) information from project database.
From my project I successfully made connection with DocuSign via PHP API and receive Embedded Singing View URL which opens my template where the user can sign document without problem.
But... all my custom text tags are empty and signer can type into them. I need to pre-fill them with signer personal data which is coming from database. I triple check custom tag label spelling, upper/lower case in my DocuSign Console and in my code as well as roleName->tagLabel relation. My PHP code is below.
Can someone, please, tell me what I am doing wrong?
I lost two days on it.
$data = array(
"accountId" => $accountId,
"emailSubject" => $this->_emailSubject,
"templateId" => $templateId,
"templateRoles" => array(
array(
"email" => $email,
"name" => $recipientName,
"clientUserId" => $clientUserId,
"roleName" => "signer",
"customFields" => array(
"textCustomFields" => array (
array (
"name" => "address",
"value" => "Address from DB",
"show" => "true",
),
array (
"name" => "city",
"value" => "City from DB",
"show" => "true",
),
array (
"name" => "state",
"value" => "State from DB",
"show" => "true",
),
array (
"name" => "phone",
"value" => "Phone from DB",
"show" => "true",
),
),
),
),
),
"status" => "sent"
);
You need to use the textTabs type in your JSON, not customFields which is used for something else. For instance, if you drag a Data Field from the UI onto the document and give it name address, to pre-fill that field you would need to reference it's tabLabel and value fields like this:
"roleName" => "signer",
"tabs" => array(
"textTabs" => array(
array(
"tabLabel"=> "address",
"value" => "123 Main St."
)
)
)
I programmatically created an app with a relationship app field
$app = new PodioApp($attributes);
After it had been successfully created, I wanted to create a relationship app field
$field_id = PodioAppField::create( array (
"type => "app",
"external_id" => "test",
"config" => array (
"label" => "Test field",
"settings" => array()
)
));
Indeed, the field is created in podio. Now, I want to assign the reference app for that relationship field and my code is as follow:
$settings = array(
"apps" => array (
array("app_id" => 10036463)
)
);
PodioAppField::update($app->app_id, $field_id, array (
"label" => "Updated_test_field",
"settings" => $settings
));
There is no error shown either on the screen or on log file. However when I check my app template on my workspace, the reference app to the relationship field is not set up.
So, if anybody could tell what's wrong with my settings, it would be nice :)
Thank you all
The config options are at: https://developers.podio.com/doc/applications
The settings name is not apps but referenced_apps and you can do this in one go. There's no reason to use 3 API calls when you can create your app with one:
$attributes = array(
"fields" => array(
array (
"type => "app",
"config" => array (
"label" => "Test field",
"settings" => array(
"referenced_apps" => array("app_id" => 10036463)
)
)
)
)
);
$app = new PodioApp($attributes);
I've omitted all the other app attributes here. I've also removed external_id since one will be automatically generated for you.
Its not working for some odd reason.
http://apidocs.mailchimp.com/api/2.0/lists/update-member.php
I want to update the Notes section on a member.
Its acting like it posts fine.
returning a valid response no error code.
but its not adding a new note to the member.
$results = $MailChimp->call("lists/update-member",
array(
"id"=> "xxxxxxx",
"email" => array(
"email" => "someemail#gmail.com",
"euid" => "xxxxxxx"
),
"merge_vars" => array(
"mc_notes" => array(
"note" => "THIS IS MY NEW NOTE"
)
),
"update_existing"=> true,
));
var_dump($results);
So I'm trying to prepopulate some fields in our DocuSign Templates when submitting them from our custom interface but the request doesn't seem to be able to find them in the templates. We're using REST, cURL and Codeigniter. My data array is as follows:
$data = array("accountId" => $accountId,
"emailSubject" => "Hello World!",
"emailBlurb" => "This comes from PHP",
"templateId" => "********-****-****-****-************",
"templateRoles" => array(
array(
"email" => "****#******.com",
"name" => "**** *****",
"roleName" => "LC3"
),
array(
"email" => $this->input->post("applicant_email"),
"name" => $this->input->post("applicant_name"),
"roleName" => "Applicant",
"tabStatuses" => array(
"textTabs" => array (
array (
"tabLabel" => "lic_num",
"tabValue" => $this->input->post("license_number")
),
array (
"tabLabel" => "ubi_num",
"tabValue" => $this->input->post("ubi_number")
),
array (
"tabLabel" => "tra_nam",
"tabValue" => $this->input->post("trade_name")
)
)
)
)
),
"status" => "sent");
I tried tabs instead of tabStatuses, but that didn't work either and our XML responses have TabStatuses instead of Tabs. Has something changed since the API Walkthroughs were put up?
EDIT: So after much trial and error with Chrome's Postman extension, this is the JSON request that I got to actually not error out:
{
"accountId":"c771ba8c-2947-4bec-acab-15b1b48a11b6",
"emailSubject":"Hello World!",
"emailBlurb":"This comes from PHP",
"templateId":"B96D0480-8792-43E8-AE11-E2AEAC74E601",
"templateRoles":[
{
"email":"mike#cloudpwr.com",
"name":"Mike Longmire",
"roleName":"LC3",
"tabStatuses":[
{
"tabStatus":[
{
"tabLabel":"lic_num",
"tabValue":"1111"
},
{
"tabLabel":"ubi_num",
"tabValue":"2222"
},
{
"tabLabel":"tra_nam",
"tabValue":"Flakey"
}
]
}
],
"email":"duckie715#gmail.com",
"name":"Mike Longmire",
"roleName":"Applicant"
}
],
"status":"sent"
}
I get back my same response:
{
"envelopeId": "0063d398-36b7-4e2f-8515-6ed9ab62aaeb",
"uri": "/envelopes/0063d398-36b7-4e2f-8515-6ed9ab62aaeb",
"statusDateTime": "2013-10-08T18:05:54.9926661Z",
"status": "sent"
}
Any ideas?
This is most likely caused by the values being returned from your function calls inside the JSON not being wrapped by quotation (") marks. To test that theory I would first just hardcode some values wherever you have a function call in your JSON (such as "email" => $this->input->post("applicant_email")) and replace with actual emails, etc and run.
If you still get the 400 error then something else is wrong with your request. If you don't, then you just need to prepend and append quotes around the values that are passed back by those function calls.
For instance, you can assign to variables, such as
$applicantEmail_1 = $this->input->post("applicant_email")
then setup your JSON like:
"templateRoles" => array(
array(
"email" => "****#******.com",
"name" => "**** *****",
"roleName" => "LC3"
),
array(
"email" => "$applicantEmail_1",
"name" => $this->input->post("applicant_name"),
"roleName" => "Applicant",
...
The nice thing about PHP is that even though that variable is in double quotes the value of the variable will still be inserted inside the quotes.
Can anyone explain how to use the AWS PHP SDK to log the metric in the style like the above screen.
I use the following PHP code but the select menu is showing "ELB: AvaliabiltyZone", how to make it show "Aggregated by AvaliabiltyZone"? What is the logic used here?
$response = $cw->put_metric_data("ELB", array(
array(
"MetricName" => "Latency",
"Dimensions" => array(
array("Name" => "AvaliabiltyZone" , "Value" => "us-east-1c")
),
"Timestamp" => "now",
"Value" => 1,
"Unit" => "None"
),
));
AvaliabiltyZone
You misspelled "AvailabilityZone"
This maybe won't answer the question, but it might fix some things...
$cw = new AmazonCloudWatch();
$cw->set_region('monitoring.'.$region.'amazonaws.com');
$res1 = $CW->put_metric_data('Sys/RDS' ,
array(array('MetricName' => 'Uptime' ,
'Dimensions' => array(array('Name' => 'AvaliabiltyZone',
'Value' => 'us-east-1c')),
'Value' => $Uptime,
'Unit' => 'Seconds')));
Click Here