hi,
how do i get the internal customer_id (at the database) when only having the agnUID ????
THANK YOU!
micha
agnUID -> customer_id ?
Moderator: moderator
-
- Posts: 1
- Joined: Wed Nov 14, 2012 4:39 pm
Re: agnUID -> customer_id ?
the agnUID is simply a base36 encoded representation that includes the following:
Company_ID
Mailing_ID
Customer_ID
URL_ID
Signature_ID
here is a quick perl diddy to decode:
Company_ID
Mailing_ID
Customer_ID
URL_ID
Signature_ID
here is a quick perl diddy to decode:
Code: Select all
#!/usr/bin/perl
use Math::Base36 ':all';
my $agnUID = 'PLACE agnUID Here';
my ($company_id, $mailing_id, $customerID, $url_id, $signature) = split(/./, $agnUID);
my @values = split(/\./, $agnUID);
my $b36 = '1h';
my $counter = 0;
foreach my $b36(@values){
$number = decode_base36( $b36 );
if ($counter == 0 ){
print "Company_ID = $number" . "\n";
}elsif($counter == 1){
print "Mailing_ID = $number" . "\n";
}elsif($counter == 2){
print "Customer_ID = $number" . "\n";
}elsif($counter == 3){
print "URL_ID = $number" . "\n";
}elsif($counter == 4){
print "Signature_ID = $number" . "\n";
}else{
print $number . "\n";
}
$counter++;
}
Re: agnUID -> customer_id ?
There is a website you can use for the base36 conversion as well:
http://www.translatorscafe.com/cafe/uni ... o-base-36/
Markus
http://www.translatorscafe.com/cafe/uni ... o-base-36/
Markus
Günstige Software gibt es bei http://www.Software-Butler.de
Re: agnUID -> customer_id ?
Have a look at the agn python module. There is a method parseUID(uidstr) that does what you want in a nice python way.
There is a method in bavd.py:
This should give you everything you need if you want to do it in another language. I'm using python so just included agn and it works great.
Cheers.
Code: Select all
uid = agn.UID ()
uid.parseUID (uidstr)
Code: Select all
def __scanUID (self, uidstr):
Cheers.