Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

API & Integration

Reply
Highlighted

PAPI to WAPI migration :

Authority
Posts: 23
93     0

How can Some one Migrate from PAPI to wAPI

I wanted to add/Update a EA to host :

how can i do that in Perl using WAPI

 

$client->GET( "/record:host?name="."$hostname\.$domain" , $headers );
my $res_data = from_json($client->responseContent());
my $key = $res_data->[0]->{_ref};
print $key;
my $ext ='{
"_ref": "$key",
"extattrs": {
"1:ID-Nr." : { "value": $id_nr },
"2:Geraeteart": { "value": $geraeteart },
"3:Geraetetyp": { "value": $geraetetyp },
"4Smiley Frustratedtandort" : { "value": $standort},
"5:Netzdose" : { "value": $netzdose},
"6:Verteiler" : { "value": $verteiler},
"7:Nutzer" : { "value": $nutzer },
"8Smiley Frustratedtruktureinheit": { "value": $struktureinheit },
"9:Tel.-Nr." : { "value": $tel },
"a:Applikationen": { "value": $applikationen },
"b:Bemerkungen" : { "value": $bemerkungen}
}
}';
# now add it
my $response = $client->PUT( "/$key"."&_return_fields=extattrs",$ext, $headers);

THe problem is instead of taking the assigned value, it tooks the literal value , can some throw light on this?

Highlighted

Re: PAPI to WAPI migration :

[ Edited ]
Community Manager
Community Manager
Posts: 159
94     0

For future posts, can you please post your code in a code block,

 

like this

 

to help with readability.  It won't convert text to smily faces and such.

 

There is a lot of similarity between PAPI and WAPI but they are not exactly the same and cannot be automatically converted.  Anything that was done in PAPI will need to be rewritten to use WAPI instead.  Fortunately with WAPI you can use the development platform of your choice, whereras PAPI will only work with Perl.

 

The EAs need to be updated together.  If you change any EAs on a record or orbject, you must push the complete set and not just a partial set in the WAPI Call.

Showing results for 
Search instead for 
Do you mean 

Recommended for You