title: Sending Notification using OneSignal Nodejs
body: <p>I'm trying to send push notification using OneSignal Node.js API, I'm targeting specific devices so I'm using the include_player_ids field, here is the code:</p>
  
  <pre><code>    function sendPushNotification(token,text){
      return new Promise((res, rej) =&gt; {
          if(token === undefined || token === null){
              return res({});
          }
  
          let token_array = [];
          token_array.push(token);
  
          const notification = {
              contents: {
                'en': text,
              },
              include_player_ids:token_array
          };
  
          return client.createNotification(notification).then(response =&gt; {
              return res(response)
          })
          .catch(e =&gt; {
              return rej(e);
          });
  
      })
  }
  </code></pre>
  
  <p>But I keep getting this error:</p>
  
  <pre><code>{
    "message": "[object Object]",
    "code": "500",
    "data": {
      "body": {
        "errors": [
          "Message Notifications must have English language content"
        ]
      },
      "statusCode": 400
    }
  }
  </code></pre>
  
  <p>Here is the documentation: but I'm having some trouble: <a href="https://www.npmjs.com/package/onesignal-node" rel="nofollow noreferrer">Node js api</a></p>
  
  <p>Thanks!</p>