• Oleksandr Generalov 1
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
Hi!
I wrote Apex class:

@RestResource(urlMapping='/show/*')
global with sharing class User{
@HttpGet global static string doGet(){
    Map < String, String > FieldMetaData = new Map< String, String >();
    FieldMetaData.put('type', 'string');
    FieldMetaData.put('label', 'label name');
    FieldMetaData.put('name', 'first name');
    FieldMetaData.put('length', '20');
    String FieldMetaDataResult = JSON.serialize(FieldMetaData);
    return FieldMetaDataResult ;
}
}

when I call it from php script the result is:
"{\"type\":\"string\",\"label\":\"label name\",\"length\":\"20\",\"name\":\"first name\"}"
How can I return result without slashes and double quotes? I need a normal json, namely:
{"type":"string","label":"label name","length":"20","name":"first name"}
Thank you!
Hi!
I know that method executeanonymous() can call Apex code.
How can I do it from PHP using php toolkit.? There is no documentation aboiut it..
Thank you!
Hi!
Guys, I need to read the value of a custom label.
I know it can be done using Apex.
I know that method executeanonymous() can call Apex code.
How can I do it from PHP using php toolkit.? There is no documentation aboiut it..
I cannot add new Apex classes through salesforce interface.
I use Salesforce sandbox.
Thank you!