Ver Mensaje Individual
  #15 (permalink)  
Antiguo 10/06/2011, 20:13
Avatar de masterpuppet
masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: Enviar attachments a zendesk con curl

Creo que el API lo soporta(al JSON) pero no estoy seguro, igual obtener el token con DOM como te sugirió abimaelrc, es bastante simple, algo asi:

Código PHP:
Ver original
  1. $xml = <<<XML
  2. <uploads token="abc123">
  3.   <attachments>
  4.     <attachment>789</attachment>
  5.  </attachments>
  6. </uploads>
  7. XML;
  8.  
  9. $dom   = DOMDocument::loadXML($xml);
  10. $token = $dom->documentElement->getAttribute('token');
  11. echo $token . PHP_EOL;

en tu caso el $xml seria la respuesta de CURL.

Saludos.
__________________
http://es.phptherightway.com/
thats us riders :)